-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: select new
PostPosted: Mon Sep 25, 2006 6:40 am 
Newbie

Joined: Mon Sep 25, 2006 6:37 am
Posts: 1
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;
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 12:10 pm 
Senior
Senior

Joined: Wed Aug 17, 2005 12:56 pm
Posts: 136
Location: Erie, PA (USA)
What error/exception are you getting? Can we see the mapping files?

_________________
---- Don't forget to rate! ----


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 3:01 pm 
Beginner
Beginner

Joined: Sat Nov 19, 2005 11:54 am
Posts: 22
did you written getter and setter methods of these classes?
you must write that.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.