Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top