Bug 42 : Order by... with 'master & detail' join... not quite right.
Priority 
Medium
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.6a
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
13/03/2008
Updated 
13/03/2008
Type 
Bug
 
Attachments 
No attachments

This is a bit confusing so to go with an example

Query<Order> query = Ebean.createQuery(Order.class);
query.join("details");
query.orderBy("details.product.id");
List<Order> orders = query.findList();

The problem here is that both the 'master' order is fetched along with the 'detail' order details - AND the order by includes a property from order details (details.product.id in this case).

In this case Ebean will automatically ensure the order by includes the order.id BEFORE a order by on any details property.

This is not quite right in 0.9.6... and Ebean will potentially give an error loading the beans.

 
Rob 13 Mar 23:29
Fixed in 0.9.6a

Fixed.

Rob 18 Mar 08:13
Note...

The issue was with CQueryPredicates.deriveOrderByWithMany().

woResponse

Upload a file