简体   繁体   English

JOOQ空状态

[英]JOOQ empty condition

Is there way to define empty condition which produces nothing in output sql query? 有没有办法定义在输出sql查询中什么都不产生的空条件? Now, for default condition I use trueCondition() 现在,对于默认条件,我使用trueCondition()

private static Condition limitCondition(Integer offset, Integer count) {
    Condition limitCondition = trueCondition();
    if (count != null && offset != null) {
        limitCondition = rowNum.between(offset, count + offset);
    } else if (count == null && offset != null) {
        limitCondition = rowNum.greaterOrEqual(offset);
    } else if (count != null && offset == null) {
        limitCondition = rowNum.lessOrEqual(count);
    }
    return limitCondition;
}

There will be DSL.noCondition() starting with jOOQ 3.11. 将以jOOQ 3.11开头的DSL.noCondition() For more details, see the relevant feature request here: 有关更多详细信息,请参阅此处的相关功能请求:

https://github.com/jOOQ/jOOQ/issues/6817 https://github.com/jOOQ/jOOQ/issues/6817

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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