3
下個createCriteria多個項目不用於搜索多個標籤工作:中的hasMany關係
def tags = "1,2,3".split(",")
def results = Item.createCriteria().list() {
itemTags {
and {
tags.each { tag ->
like("name", tag)
}
}
}
}
但它似乎工作,如果我改變和到或。
編輯:在我調試,我發現的標準是:
(itemTags_alias1.name=1 and itemTags_alias1.name=2 and itemTags_alias1.name=3)
這是不是我的目標來完成。我想檢查一個項目是否有全部三個標籤。