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: Fetch.JOIN
PostPosted: Fri Jan 26, 2007 9:50 am 
Newbie

Joined: Fri Jan 05, 2007 6:44 am
Posts: 12
I have a question about the use of Fetch.JOIN I would like some advice on.

The gui I am developing is seperate from the business tier and therefore I am 'preparing' the objects I need so that I dont get Lazy exceptions.

99% of the non-lazy configuration is done using Fetch.JOIN as apposed to in the xml mappings because other systems access this shared business tier/service.

The result is I end up with queries like so with many JOIN modes:

Code:
List accounts = getSessionFactory().getCurrentSession()
             .createCriteria(Account.class)
              .add(Restrictions.eq("uuid", uuid))              
              .setFetchMode("parentAccountGroups", FetchMode.JOIN)
              .setFetchMode("childAccountGroups", FetchMode.JOIN)
              .setFetchMode("generalPositionLimit",FetchMode.JOIN)
              .setFetchMode("generalClipSizeLimit",FetchMode.JOIN)
              .setFetchMode("bookableInstrumentGroups",FetchMode.JOIN)
              .setFetchMode("bookableInstrumentGroups.clipSizeLimit",FetchMode.JOIN)
              .setFetchMode("bookableInstrumentGroups.positionLimit",FetchMode.JOIN)
              .setFetchMode("type", FetchMode.SELECT)
              .list();


Is this a good approach or should I use Hibernate.initialise instead of all the JOIN statements

best regards

JC


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.