-->
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: New LEFT OUTER JOIN criteria query already mature?
PostPosted: Mon Sep 18, 2006 7:25 am 
Newbie

Joined: Wed Aug 03, 2005 11:04 am
Posts: 10
I am sorry I don't have the time to compile a testcase :-(. If you don't have the time to look into it, so be it.

We used the "newer"
Code:
public Criteria createCriteria(java.lang.String associationPath, int joinType)

methode on the Criteria object.
When we set the joinType to a LEFT OUTER JOIN the collection with the details records got not properly loaded. I traced through the sourcecode and found that in the process of loading the stuff the collection is set to "initialized" already. In the case of the usuale INNER JOIN the collection is not initialized after the query and gets properly fetched at the first access.

Example:

Foo references Bar with a one-to-many relation.

Criteria written as HQL:

Code:
Select f from Foo f INNER JOIN Bar b on f.bars=b with b.prop = 'value'

-> f.bars is properly initialized at access

Code:
Select f from Foo f LEFT OUTER JOIN Bar b on f.bars=b with b.prop = 'value'

-> f.bars only contains the one entry that fullfills the where part

These queries are formulated with the Criteria API, not in HQL as written here.

Tested with Hibernate 3.2cr2 and cr4.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 18, 2006 7:29 am 
Newbie

Joined: Wed Aug 03, 2005 11:04 am
Posts: 10
BTW this feature was added as an external patch: http://opensource.atlassian.com/project ... e/HHH-1005


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.