Bug 287 : Support having orderBy segments with +query joins / filterMany
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.6.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
22/04/2010
Updated 
22/04/2010
Type 
Bug
 
Attachments 
No attachments
List<Order> list = Ebean.find(Order.class)
            .fetch("details", new FetchConfig().query())
            .order().asc("id")
            .order().desc("details.id")
            .findList();

So in the example above, there is a query join on "details" ... and this means the order().desc("details.id") needs to be removed from the main query and onto the secondary query (+query join).

This is also the same with filterMany.

List<Customer> list3 = Ebean.find(Customer.class)
            .fetch("orders")
            .filterMany("orders").eq("status", Order.Status.NEW)
            .order().desc("orders.id")
            .findList();

The filterMany uses a query join ... and so the above .order().desc("orders.id") is removed from the main query and put onto the filterMany query.

 
Rob 22 Apr 00:02
Fixed in HEAD

See TestQueryFetchJoinWithOrder

Fixed in HEAD.

woResponse

Upload a file