Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top