Enhancement 173 : ENHANCEMENT: +query ... "query joins" or "secondary queries"
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.2.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
01/11/2009
Updated 
01/11/2009
Type 
Enhancement
 
Attachments 
No attachments

Some Object graphs can not be built efficiently with a single query. This feature allows the developer to define multiple queries to build an object graph.

For example, when you have an entity with 2 or more OneToMany relationships a single query results in a Cartesian product which is generally expensive.

 
Rob 01 Nov 11:17
A +lazy join ... executed immediately after the parent join

This is really a +lazy join that will instead be executed immediately after it's parent query has run.

If no batch size has been specified then it will use a default of 100.

Rob 01 Nov 11:22
Example
List<Order> list = Ebean.find(Order.class)
    .join("customer", new JoinConfig().query(3).lazy(10))
    .findList();

Find Orders
.. then immedidately Load the first 3 customers referenced by those orders
.. after that lazy load customers 10 at a time as needed

woResponse

Upload a file