接口 MutableSubQuery
- 所有超级接口:
Filterable,MutableQuery,Sortable,SubSelectable
- 所有已知实现类:
MutableSubQueryImpl
-
方法概要
修饰符和类型方法说明exists()groupBy(Expression<?>... expressions) orderBy(Expression<?>... expressions) default MutableSubQuerydefault MutableSubQueryorderByIf(boolean condition, Expression<?>... expressions) default MutableSubQueryAdd some predicates(logical and)default MutableSubQueryAvoid using this method whenever possible, usingDynamic Predicatesare a more convenient approach.default MutableSubQuery已过时。从接口继承的方法 org.babyfish.jimmer.sql.ast.query.selectable.SubSelectable
select, select, select, select, select, select, select, select, select, selectComparable, selectCount, selectNumber, selectString
-
方法详细资料
-
where
从接口复制的说明:FilterableAdd some predicates(logical and)- 指定者:
where在接口中Filterable- 指定者:
where在接口中Sortable- 参数:
predicates- Predicates, everything one can be null- 返回:
- Return the current object to support chain programming style
-
whereIf
已过时。This method is deprecated, usingDynamic Predicatesis a more convenient approach.Please look at this example:
WhenwhereIf(name != null, table.name().eq(name))nameis null, this code works becauseeq(null)is automatically translated by Jimmer toisNull(), which doesn't cause an exception.Let's look at another example:
Except RUST marco, almost all programming languages calculate all parameters first and then call the function. Therefore, beforewhereIf(minPrice != null, table.price().ge(minPrice))whereIfis executed,ge(null)already causes an exception.For this reason,
whereIfprovides an overloaded form with a lambda parameter:
Although this overloaded form can solve this problem, it ultimately adds a mental burden during development.whereIf(minPrice != null, () -> table.price().ge(minPrice))Therefore, Jimmer provides
Dynamic Predicates- Java: eqIf, neIf, ltIf, leIf, gtIf, geIf, likeIf, ilikeIf, betweenIf
- Kotlin: eq?, ne?, lt?, le?, gt?, ge?, like?, ilike?, betweenIf?
geIfas an example, this functionality is ultimately implemented like this.where(table.price().geIf(minPrice))- 指定者:
whereIf在接口中Filterable- 指定者:
whereIf在接口中Sortable
-
whereIf
从接口复制的说明:FilterableAvoid using this method whenever possible, usingDynamic Predicatesare a more convenient approach.Please look at this example:
WhenwhereIf(name != null, table.name().eq(name))nameis null, this code works becauseeq(null)is automatically translated by Jimmer toisNull(), which doesn't cause an exception.Let's look at another example:
Except RUST marco, almost all programming languages calculate all parameters first and then call the function. Therefore, beforewhereIf(minPrice != null, table.price().ge(minPrice))whereIfis executed,ge(null)already causes an exception.For this reason,
whereIfprovides an overloaded form with a lambda parameter:
Although this overloaded form can solve this problem, it ultimately adds a mental burden during development.whereIf(minPrice != null, () -> table.price().ge(minPrice))Therefore, Jimmer provides
Dynamic Predicate- Java: eqIf, neIf, ltIf, leIf, gtIf, geIf, likeIf, ilikeIf, betweenIf
- Kotlin: eq?, ne?, lt?, le?, gt?, ge?, like?, ilike?, betweenIf?
geIfas an example, this functionality is ultimately implemented like this.where(table.price().geIf(minPrice))- 指定者:
whereIf在接口中Filterable- 指定者:
whereIf在接口中Sortable- 参数:
condition- The conditionblock- A lambda to create predicate when condition is true- 返回:
- Return the current object to support chain programming style
-
orderBy
- 指定者:
orderBy在接口中MutableQuery- 指定者:
orderBy在接口中Sortable
-
orderByIf
- 指定者:
orderByIf在接口中MutableQuery- 指定者:
orderByIf在接口中Sortable
-
orderBy
- 指定者:
orderBy在接口中MutableQuery- 指定者:
orderBy在接口中Sortable
-
orderByIf
- 指定者:
orderByIf在接口中MutableQuery- 指定者:
orderByIf在接口中Sortable
-
orderBy
- 指定者:
orderBy在接口中MutableQuery- 指定者:
orderBy在接口中Sortable
-
orderByIf
- 指定者:
orderByIf在接口中MutableQuery- 指定者:
orderByIf在接口中Sortable
-
groupBy
- 指定者:
groupBy在接口中MutableQuery
-
having
- 指定者:
having在接口中MutableQuery
-
exists
Predicate exists() -
notExists
Predicate notExists()
-