From: Darryl D. (JIRA) <no...@at...> - 2006-05-10 19:46:12
|
Add outer join support to DetachedCriteria API for subcriteria -------------------------------------------------------------- Key: HHH-1738 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1738 Project: Hibernate3 Type: Patch Components: core Versions: 3.1.3 Environment: Hibernate-3.1.3 all database platforms Reporter: Darryl Dieckman Attachments: DetachedCriteria.patch This is a fix related to an already submitted patch for HHH-1162. This patch adds the ability to specify a join type for a subcriteria of a DetachedCriteria. The patch was originall part of a larger patch (HHH-1276) that was not fully applied for some reason. A quick summary of the problem occurs when a subcriteria is created for a detached criteria. For example, say you have Foo which has an association to Bar and you want to select all the Foo instances and order by a property of bar. You might say: DetachedCriteria criteria = DetachedCriteria.forClass( Foo.class ); criteria.createCriteria( "bar" ).addOrder( Order.asc( "someproperty" ) ); In this case the subcriteria will generate an inner join which could have an adverse effect on the results of the query if the user is expecting Foo's will null Bar references to still be returned. The patch will allow the user to say: DetachedCriteria criteria = DetachedCriteria.forClass( Foo.class ); criteria.createCriteria( "bar", JoinFragment.LEFT_OUTER_JOIN ).addOrder( Order.asc( "someproperty" ) ); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |