Skip to content

GRAILS-9280: Various issues with DetachedCriteria and Where queries #5153

@graemerocher

Description

@graemerocher

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)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions