i have 3 domain objects
class orgprofile { string name static mapping = { discriminator column:'org_type' } } class org extends orgprofile { static mapping = { discriminator 'org' } } class jurisdiction extends orgprofile { string email static mapping{ discriminator 'jurisdiction' } }
i need search name , email list of org , jurisdiction
so like
def criteria = orgprofile.createcriteria() criteria.list{ or { ilike("name", "%${token}%") ilike("email", "%${token}%") } }
where token
string. how can achieved?
tried code:
def criteria = orgprofile.createcriteria() def results = criteria.list{ or { ilike("name", "%${token}%") ilike("email", "%${token}%") } }
results expected.