Bug 43 : query.select() containing a many property errors...
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.6a
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
18/03/2008
Updated 
18/03/2008
Type 
Bug
 
Attachments 
No attachments

Typically you will not put a "many" property in the select clause but rather in a join()... but if you do you'll get an error.

In the example below "details" is a one to many property on bug.

Query<Bug> query = Ebean.createQuery(Bug.class);
query.select("title, details");
query.findList();

// the above will error...

Query<Bug> query = Ebean.createQuery(Bug.class);
query.select("title");
query.join("details");
query.findList();

 
Rob 18 Mar 08:12
Fixed in 0.9.6a

The fix is to override in BeanPropertyAssocMany the appendSelect() and readSet() methods.

woResponse

Upload a file