Quantcast

GORM - how to set criteria for object with list or set of strings?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GORM - how to set criteria for object with list or set of strings?

frankie kuo
 How to create criteria for this kind attribute:

 for example:

   class Book {
       static hasMany = [references:String]
       Set references
   }


 when we need use some reference string as a search condition, how to find out books with these reference string?
------------------------------------------------------------------------------------------------
 def books = Book.createCriteria().list() {
   
    references {
       ilike(?, 'grails user guide')
    }
 }

 the above code will not work ... is anyone can give suggestions?

 my solution is use sql PreparedStatment to query now.
Loading...