You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
where: a static field holding a chain of where queries keeps only the last one #17212
A static field or static property of a domain class that holds a chain of where queries keeps only the last one, and builds it on the class that holds the field:
@EntityclassBook {
String title
static recent =Author.where { name =='x' }.where { age >1 }
}
Book.recent is a query on Book with the restriction age > 1 only. The same chain written in a method queries Author with both restrictions. The unqualified form, where { ... }.where { ... }, loses all but the last query as well.
Seen on 7.2.x at a19d39f with the in-memory datastore.
Cause: the transform replaces the whole initial value of such a field with one criteria built from the last closure.
Activity
borinquenkid commentedon Nov 28, 2026
#17214 fixes chains of
whereandwhereLazy. This issue stays open for chains with another call in them or from a stored criteria.