Its not bugs per-se.  It’s just that Loader currently cannot deal with the results as they are returned from the join query with the new filter many-to-many filters.  The issue is in Loader though.

 

I believe there was a bug in OJL regarding forcing an inner join from the association table to the entity-element table (the call to getJoinType() made from walkCollectionTree()).  I made a change here such that an inner join is only used here for many-to-many when the collection itself is the entry point in the load (currentDepth == 0).  This bug caused rows to not be returned in scenarios where a fetch join was used “the whole way across” a many-to-many if the root entity did not have any rows in the association table due to the inner join used here (load and criteria only).

 

Just to be clear, we are talking about two separate issues relating to many-to-many really:

1)       The type of join to use for join fetched many-to-many associations.  The verdict here was that fetches should use outer joins.  CriteraQuery.createQuery() should use inner joins; CriteriaLoader already handles this scenario.  So from Loader the only time an inner join should really be used is if it is a collection loader for the many-to-many; that’s what my change does.

2)       The contract between Loader and the two persisters for a many-to-many is such that the collection is populated based on the fk value from the association table; the collection elements are built off of the pk value from the entity table.  In the correct join scenario (two outer joins) those two values do not necessarily match with a filter applied to the many-to-many collection element table (the filter correctly filters the row from the element table, but it does not/cannot filter the row from the association table)…

 


From: Gavin King
Sent: Saturday, April 23, 2005 12:01 PM
To: Steve Ebersole; 'hibernate-devel@lists.sourceforge.net'
Subject: RE: [Hibernate] 3.0.2

 

The problems you were having that you thought were bugs in OJL: were they actually bugs in existing functionality, or was it just a problem for the new functionality (ie. the filters)?

 

The last time we spoke, I got the impression that your problems with many-to-many joins were new functionality only.

 


From: Steve Ebersole
Sent: Saturday, 23 April 2005 9:25 AM
To: Gavin King; hibernate-devel@lists.sourceforge.net
Subject: RE: [Hibernate] 3.0.2

 

The many-to-many filters are still not ready; I’m still working on that issue with Loader and filtered joins across the association table.

 

Up to you whether you want to hold up 3.0.2 to get this in. 

 

All the other stuff I had for 3.0.2 is done.  We initially were tentative regarding getting the many-to-many filter stuff into 3.0.2 anyway

 

Your call.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin King
Sent: Saturday, April 23, 2005 12:55 AM
To: hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] 3.0.2

 

Are we good for a 3.0.2 release this weekend?

 

Steve. are you ready?

 

Who wants to do the build?

Reply via email to