-->
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.  [ 2 posts ] 
Author Message
 Post subject: failed getting list using JOIN with createQuery
PostPosted: Wed Dec 20, 2006 5:31 am 
Newbie

Joined: Tue Oct 17, 2006 5:18 am
Posts: 9
Hi All

I use hibernate 3.2
I try to get list of object using createQuery()

"Query query = sess.createQuery("from GaTran g join fetch g.useridin join fetch g.useridout join fetch g.vhctype join fetch g.memberid join fetch g.priceid join fetch g.appparamid where g.vhctimein >= :startdate and g.vhctimeout <= :enddate and g.vehiclenum like :inputsearch").setCalendar("startdate", startdate).setCalendar("enddate", enddate).setString("inputsearch", inputsearch.toUpperCase());
List lst = query.list();"

How come when I iterate lst object I got empty List but when I remove the JOIN in query, lst contain object data.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 11:19 am 
Beginner
Beginner

Joined: Thu Oct 12, 2006 6:19 pm
Posts: 34
Location: Guatemala
Hi, maybe the problem is with your database dialect isn't understanding your join syntax, have you tried with another hql syntax? please, show the sql query generated

_________________
God is Love


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.