hello, i'm trying to retrieve a list of countries (country Id, code and code value)...i'm new...i'm sure there must be something missing in the method below...pls help
class LgItem {
private BigDecimal lgItemId;
private BigDecimal lgGroupId;
private BigDecimal langId;
private String cd;
private String cdVal;
}
class CcaCountries {
private BigDecimal countryId;
private String countryCd;
}
class CountriesListDTO {
private BigDecimal countryId;
private String countryCd;
private String countryCdVal;
}
public List getCountries() {
String hqlQuery = "select new CountriesListDTO(c.countryId,c.countryCd,i.cdVal) from CcaCountries c,LgItem i where c.countryCd=i.cd and i.langId=2 and i.lgGroupId=3 order by c.countryId asc";
List countriesList = getHibernateTemplate().find(hqlQuery);
return countriesList;
}
|