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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top