Hi
[Previous post sent incomplete…]
I’m getting re-acquainted with ColdBox after very many years and I haven’t used its ORM or Hibernate before.
I’m using CriteriaBuilder to do this:
prc.domainACSTTemplate = c
.createAlias(‘ACCR_DOMA_KY’, ‘d’, c.LEFT_JOIN)
.withProjections(property = ‘ACMA_KY,d.SHORT_DESCRIPTION_LB’)
.isNull(‘ACCR_TYPE’)
.list();
…which works, but isNull(‘ACCR_TYPE’) isn’t what I want. I actually want is:
“(where ACCR_TYPE is null or ACCR_TYPE <> 2)”
That is, null, 0 or 1 would be acceptable.
I have tried many options but all seem to cause syntax errors, among them are:
.isNot(‘ACCR_TYPE’, JavaCast(“int”, 2))
.or(‘ACCR_TYPE is null’, ‘ACCR_TYPE = JavaCast(“int”, 1)’, ‘ACCR_TYPE = JavaCast(“int”, 2)’)
.or(isNull(‘ACCR_TYPE’), isEq(‘ACCR_TYPE’, JavaCast(“int”, 0)), isEq(‘ACCR_TYPE’, JavaCast(“int”, 1)))
I just need to get my head around the right syntax, but I can’t get it, and I don’t find enough examples of NOT and OR in the tutorials/documentation.
Can anyone help?
Thanks,