Bug 261 : filterMany requires +query or +lazy join - should automatically convert...
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.6.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
31/03/2010
Updated 
31/03/2010
Type 
Bug
 
Attachments 
No attachments

The filterMany() actually requires a separate SQL query and that means it should always be executed on a +query join really.

Ebean should automatically convert the join to be a +query join, otherwise it will end up as a filter on the root level (which is not the expected/documented behaviour).

 
Rob 31 Mar 03:33
Example
List<Customer> list = Ebean.find(Customer.class)
            .select("id, name, status, shippingAddress")
            .fetch("contacts", "firstName,email")//, new FetchConfig().query())
            .filterMany("contacts").ilike("firstName", "J%").query()
            .order().desc("id")
            .findList();

So Ebean will automatically add the FetchConfig.query() to the "contacts" fetch path due to the filterMany being applied to that path.

ie. Currently you need to manually define the new FetchConfig().query()... and if you don't it will effectively filter the root level beans.

Rob 31 Mar 03:35
Fixed in HEAD

Fixed in HEAD.

Ebean will automatically add +query(100) +lazy(100) to a fetch path that has filterMany on it.

woResponse

Upload a file