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
|