Accessing Data : Using POJO data in a report : Specifying the data to retrieve from a POJO
 
Specifying the data to retrieve from a POJO
BIRT reports must use data that is structured as a table consisting of rows and columns. For a POJO data set to return data in this format, you map methods or members of a POJO class to columns. Listing 4‑1 shows an example of a class that represents music CDs. The class describes the members and uses pairs of get and set methods to persist the data. To create a data set using this class, you would map the get methods to columns.
Listing 4‑1 Class representing music CDs
package dataset;
public class CD {
private String cdTitle;
private String cdArtist;
private String cdCountry;
private String cdCompany;
private String cdPrice;
private String cdYear;
public CD(String title) {
this.cdTitle = title;
}
public String getCDTitle() {
return cdTitle;
}
public void setCDTitle(String title) {
this.cdTitle = title;
}
public String getCDArtist() {
return cdArtist;
}
public void setCDArtist(String artist) {
this.cdArtist = artist;
}
public String getCDCountry() {
return cdCountry;
}
public void setCDCountry(String country) {
this.cdCountry = country;
}
public String getCDCompany() {
return cdCompany;
}
public void setCDCompany(String company) {
this.cdCompany = company;
}
public String getCDPrice() {
return cdPrice;
}
public void setCDPrice(String price) {
this.cdPrice = price;
}
public String getCDYear() {
return cdYear;
}
public void setCDYear(String year) {
this.cdYear = year;
}
}