gorm - Grails criteria query checking `OR` logic -
i having grails criteriaquery
checking or
logic againist single state variable this:
or { eq("status", status.one) eq("status", status.two) eq("status", status.three) }
this code working fine, question is, checking or
logic againist single state, there way optimize code like
eq("status",status.one || status.two || status.three)
thanks in advance.
you can use
'in'( "status", [status.one, status.two, status.three] )
or
'in'( "status", status.values() )
if status
enum values one, 2 & three.
Comments
Post a Comment