Original Reporter: longwa
Environment: Testing on Windows 7, x64, Grails 2.1.0
Version: 2.1
Migrated From: http://jira.grails.org/browse/GRAILS-9280
This ticket is the parent for several slightly different (but possibly) related sub-issues regarding the new Where and DetachedCriteria support.
Specifically:
- findAll and withCriteria can take similar closures and quietly return different results (SQL has invalid 1=1)
- findAll quietly ignores criteria on associations referenced via the Closure syntax
- findAll quietly ignores criteria on any properties accessed via more than one association A.B.C == 'foo' (SQL has invalid 1=1 where clause)
- findAll throws an exception if comparing a property to a property on an associated domain (prop == B.prop)
- findAll throws an exception if using the Closure syntax to reference associations more than one level deep.
- where() chaining ignores criteria unless the chained query is in the same scope (defining a DetachedCriteria on the domain and then chaining elsewhere silently ignores the additional criteria)
Original Reporter: longwa
Environment: Testing on Windows 7, x64, Grails 2.1.0
Version: 2.1
Migrated From: http://jira.grails.org/browse/GRAILS-9280
This ticket is the parent for several slightly different (but possibly) related sub-issues regarding the new Where and DetachedCriteria support.
Specifically: