Question

I have a domain as below:

class Event {
  String name
  Set tags
  //.... other properties

  static hasMany = [tags: String]
}

Now, I want to implement an query for search for Event using a list of String. The search should support a 'like' based search. i.e if an Event has tag like 'annual meeting', then string 'meeting' should give that event as result.

Can this be achieved using GORM criteria?

Était-ce utile?

La solution

Due to https://hibernate.atlassian.net/browse/HHH-869 there is no way to query a collection of value types with Hibernate (which GORM uses)

You must use HQL instead.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top