Reputation: 999
I am working on some project in Grails and using where
query.
I figured out that it is returning more data than it should be.
I put in third row false
value in order to make where
return empty list.
However, list is not empty.
Can someone tell me what is wrong with my code.
Here are two examples(I tried both options and both return list which is not empty).
Example 1:
List<Settings> settingsList = Settings.where{
userId == user.id &&
startDateData.specificDate <= specificDate &&
false
}.list(sort:"startDateData", order:'desc')
Example 2:
List<Settings> settingsList = Settings.where{
userId == user.id
startDateData.specificDate <= specificDate
false
}.list(sort:"startDateData", order:'desc')
Upvotes: 0
Views: 47
Reputation: 27220
The only expressions that directly affect the query criteria are those for which the LHS references a persistent property. The expression false
isn't one of those expressions.
Upvotes: 1