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

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -