简体   繁体   中英

Jooq combine a list of OR conditions to a condition with AND

I have a list of conditions which should be combined with OR

List<Condition> conditions; //conditionA, conditionB, ... other conditions

I have another condition

Condition dateCondition;

Now I want to combine as below

dateCondition AND (conditionA OR conditionB ...)

What would be a good way to do this.

Is there a Jooq function to do this.

Write

dateCondition.and(DSL.or(conditions))

The method you're looking for is DSL.or(Collection<? extends Condition>)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM