-->
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: wierd result set using spring hibernatetemplate
PostPosted: Thu Nov 30, 2006 8:40 pm 
Beginner
Beginner

Joined: Mon Jun 19, 2006 4:10 pm
Posts: 27
Im using Spring hibernateTemplates to perform a search. My daoImpl looks like

Code:
public List<Game> findWinningAces(String hero)
   {
      List<Game> results = getHibernateTemplate()
            .find(
                  "FROM Game as g join g.holdings as h with h.herosHolding = 1 join h.persistedHoldingClassification as c"
                        + " WHERE c IN ('ACES') AND g.gameResolution.winner = ?",
                  hero);

      return results;
   }


The wierd thing is that each element in the list returned is not a Game, but an array of Objects, the first of which is a Game and the second of which is another Object (holdings, from the hql above, is a set of these objects)

how is hibernate packaging each row of the result set as an Object array?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 2:11 am 
Regular
Regular

Joined: Mon Nov 24, 2003 6:36 pm
Posts: 105
that is normal when you have explicit joins in hql. If you want collections loaded, use join fetch.

see 11.3 "join fetch" in the manual.


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.