Bug 231 : Lazy loading on OneToMany with @Where clause .... gives errors
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.5.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
03/03/2010
Updated 
03/03/2010
Type 
Bug
 
Attachments 
No attachments

Caused by: java.lang.RuntimeException
at com.avaje.ebean.server.core.DefaultBeanLoader.loadMany(DefaultBeanLoader.java:152)

The problem here is that the checking code assumed the join to the many was always going to effectively be an outer join.

That is not the case with a @Where in place.

 
Rob 03 Mar 12:59
Removing check...

Removing that check can result in:

java.lang.NullPointerException
at com.avaje.ebean.common.BeanList.size(BeanList.java:394)
at com.avaje.tests.batchload.TestEmptyManyLazyLoad.test(TestEmptyManyLazyLoad.ja

Here the code assumed that the list that was lazy loaded will be empty if there are no rows... but with the @Where the empty list is not set and the underlying list is still null after the lazy load.

Rob 03 Mar 13:10
Fixed in HEAD

Fixed in HEAD.

woResponse

Upload a file