Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top