-->
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.  [ 1 post ] 
Author Message
 Post subject: Conditions on a Set / HQL / Object creation
PostPosted: Wed Nov 29, 2006 5:15 pm 
Newbie

Joined: Wed Sep 20, 2006 7:42 am
Posts: 12
Location: Sweden
Hi,

I have a few wonderings.

First. Is it possible to set conditions on members of type set in a single query?
Eg. I have a class Team that among others consists of a set of games and I want to fetch the Team, but the method getGames() should only return games that were played after a given date.

class Team{

private String name;
private Set<Game> games;
...


}

class Game {

private Team homeTeam;
private Team awayTeam;
...

}


The second issue is perhaps stupid, but I am wondering how objects are created, say I write List team = teamDao.findById(aId). Team has asscociated games. Say there are 1000000 games to this team and I have a jsp page that invokes only and only aTeam.getName() and dispatches the output to the browser. Are the games fetched and placed into the instance???

EDIT: With some debugging I have now realized that all the games are placed in the team instance when List team = teamDao.findById(aId) is invoked. Is it possible to make some configuration that inserts the games into the team instance, when I implicitly write team.getGames().



All the best,
Thomas


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

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.