gpt4 book ai didi

grails - GORM查询:findAllByPropertyNotInList或findByPropertyNotInList不存在,是否等效?

转载 作者:行者123 更新时间:2023-12-02 15:32:26 37 4
gpt4 key购买 nike

下一个代码有效:

self query1 = DomainClassExample.findAllByPropertyInList("hi","bye")

但是,如果我添加 不是,则动态查找器不存在(确实存在:请检查答案):
self query2 = DomainClassExample.findAllByPropertyNotInList("hi","bye")

我想获取所有没有属性“hi”或“bye”的DomainClassExample。是否有用于此目的的动态取景器?我应该使用Where查询吗?怎么样?

最佳答案

在Grails 1.3.9中,给出以下域:

class User {
String username
....
}

这在我们的应用程序中可以正常工作:
def userList = User.findAllByUsernameNotInList(["user1@testdomain.com","user2@anotherdomain.com"])

关于grails - GORM查询:findAllByPropertyNotInList或findByPropertyNotInList不存在,是否等效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17495863/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com