我有这个标准:
def myList = BAS.createCriteria().list () {
projections { distinct ( "id" )
property("date")
property("id")
}
carList{
eq("login",login)
}
ccList{
eq("cmd",false)
}
order("date","desc")
}
我还要添加 null 作为“cmd”的条件。在我的案例中是否有使用OR?
由于
答案 0 :(得分:4)
是的,在这种情况下你可以使用OR。
ccList {
or {
eq("cmd", false)
isNull("cmd")
}
}
documentation概述了此选项和其他选项。在rest of the documentation中也可以找到更多信息。