Hi. I have problem (Hibernate 3.6.5 and 3.6.10) with function createCriteria(String associationPath, String alias, int joinType, Criterion withClause) of class org.hibernate.criterion.DetachedCriteria
I have object (for example person with cars) with lazy loaded collection (cars - specified by hbm.xml) and when I want load this object with collection (person+cars) with parameter joinType= DetachedCriteria.LEFT_JOIN and without using withClause everything is ok (using createCriteria(String associationPath, String alias, int joinType)).
But when I use restriction on cars collection (createCriteria(String associationPath, String alias, int joinType, Criterion withClause) ) the cars are not loaded and LazyInitializationException is thrown during access to person cars.
Generated sql seems to be as I would expect (withClause adds only restriction to join part - rest of the booth sql are identical).
Summarized: Using Criterion C causes that collection is not loaded.
This useful feature (withClause) was not present in older version so can it be problem with new added functionality( somewhere in class JoinWalker and property hasRestrict?) ?
Thank you for response..
|