Bug 38 : Join missing in sql select ... when WHERE expression requires join...
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.6
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
22/02/2008
Updated 
22/02/2008
Type 
Bug
 
Attachments 
No attachments

This was introduced in 0.9.5.

Query[User] query = Ebean.createQuery(User.class);
query.addWhere(Expr.eq("loggedBugs.duplicateOf", "12"));

... the issue being the the property "loggedBugs.duplicateOf" will require a join and this is normally detected and added. The bug is that this is not the case in 0.9.5.

 
Rob 22 Feb 02:43
Just to note...

If there is a explicit join on the query then the error does not appear...
Aka: query.join("loggedBugs");

Rob 22 Feb 02:45
Fixed: 0.9.5b

Stupid bug... all 'includes'/'joins' are tested in lower case... the bug was that loggedBugs was not converted to loggedbugs (lower case b). Ironically the idea of using all lower case was to reduce issues like this :).

Oh well, fixed in 0.9.5b.

Rob 22 Feb 02:48
Introduced in 0.9.5...

Worth noting that I introduced this in version 0.9.5. The way that logical property names are converted to database column names was changed. The code is better but came with this bug :(

woResponse

Upload a file