I have this Criteria:

def myList =  BAS.createCriteria().list () {
  projections { distinct ( "id" ) 
      property("date")
      property("id")
  }

  carList{ 
      eq("login",login)    
          }

  ccList{
      eq("cmd",false)
        }


  order("date","desc")
}

I want to add also null as a criteria for "cmd". Is there an OR to be used in my case?

Thanks

有帮助吗?

解决方案

Yes, there is an OR that you can use in this case.

ccList {
  or {
    eq("cmd", false)
    isNull("cmd")
  }
}

The documentation has this and other options outlined. Further information is also found throughout the rest of the documentation.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top