-->
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.  [ 4 posts ] 
Author Message
 Post subject: Overriding lazy when using FetchMode.SELECT
PostPosted: Wed Mar 19, 2008 11:08 am 
Beginner
Beginner

Joined: Mon Aug 01, 2005 3:51 pm
Posts: 22
Why is there the ability to use lazy="false" and fetch="select" in the mapping, but not in the Criteria API.

For example, if I have lazy="proxy" and fetch="select", why can't I call criteria.setLazy on the association so that it will behave exactly as if I had lazy="false" and fetch="select", but just for that Criteria?

Criteria.setFetchMode does not help me. I do not want to do a join fetch. I want it to do a select fetch. I just want to change "WHEN" it is loaded, not "HOW".


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 12:46 pm 
Beginner
Beginner

Joined: Mon Aug 01, 2005 3:51 pm
Posts: 22
Let me try asking this a different way ...

How can I eagerly fetch an association using "select" fetching if the association mapping is configure as lazy="true"? It appears that doing a "join" fetch is my only option in either the Criteria or Query API.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 12:47 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
billsalvucci wrote:
Let me try asking this a different way ...

How can I eagerly fetch an association using "select" fetching if the association mapping is configure as lazy="true"? It appears that doing a "join" fetch is my only option in either the Criteria or Query API.


You can do a fetch join. That ignore the lezy setting.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 09, 2008 7:26 pm 
Beginner
Beginner

Joined: Mon Aug 01, 2005 3:51 pm
Posts: 22
I want to do the fetch in a separate select; I don't want to do a sql join. That is the whole point. I have several collections that need to be fetched. If I join them all, I end with the Cartesian Product problem. I have found doing separate selects to much more performant.


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