I have an existing criteria to which I want to add one more criterion that ORs with the preexisting criteria. I'd like to add that I cannot control how the preexisting criteria is constructed.
For eg: My preexisting criteria translates to the following SQL: select * from users where status = 'ACTIVE' and acctId = xyz
I want to add a criterion which would change this query to select * from users where (status = 'ACTIVE' and acctId = xyz) or deptId = abc.
I am unable to find a way to modify the exitsing criteria to become part of a disjunction.
My object looks like:
User{Long userId, String status, Long acctId, Long deptId}
Any pointers appreciated.
Thanks, W