Bug 24 : Incorrect parsing: Query threw SQLException:Unknown column 'bug.product.name' in 'where clause'
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.3
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
13/08/2007
Updated 
13/08/2007
Type 
Bug
 
Attachments 
No attachments

The parsing of predicates in the where clause has a bug. When the depth of the property is greater than 1 (from the root object) then the property does not get converted into the appropriate DB column.

For example, with a query on BugDetail objects, bug.product.name has a depth of 2 relative to BugDetail... and 'bug.product.name' is not converted to the appropriate db column.

 
Rob 13 Aug 06:31
Reproduce example

dsf

Rob 13 Aug 06:41
ex query...

SELECT d.id, d.body, d.cretime, d.post_date, d.title, d.updtime, d.bug_id, d.user_id
FROM b_bug_detail d
JOIN b_bug bb ON d.bug_id = bb.id
WHERE bug.product.name LIKE ?

And bug.product.name has not been translated to the approriate DB column.

Rob 13 Aug 06:57
Bug in SqlDeployParser

This is a bug in this class. Lines 154 to 161, can be replaced by just...
String search = propertyPrefix '.';

Fixed in 0.9.3

woResponse

Upload a file