문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top