5
有沒有辦法使用findWhere
和一個不等於值(試圖使用它與標準)?grails findWhere不等於
E.g.
Books.findWhere('sale' : true, 'category': ne('exclude me'))
我有一個有效的解決方案,但不知道是否有使用findWhere
我覺得很簡單的閱讀方式。
def result = Books.createCriteria().get{
eq('sale', true)
ne("category", 'exclude me')
}