I have a domain Payment
class Payment {
String name
PaymentType paymentType
}
PaymentType is an ENUM
to search
@ataylor:
I am not really sure.. but shouldnt it be
def results = Payment.createCriteria().list {
'in' ('paymentType',new params.paymentType.collect{PaymentType.valueOf(it)})
}
or you'll be getting an error
groovy.lang.MissingPropertyException: No such property: params for class: grails.orm.HibernateCriteriaBuilder
If paymentType is an array, you can do something like this:
def results = Payment.createCriteria().list {
'in' ('paymentType', params.paymentType.collect{PaymentType.valueOf(it)})
}