接口 MutableRootQuery<T extends Table<?>>
- 所有超级接口:
Filterable,MutableQuery,RootSelectable<T>,Sortable
- 所有已知实现类:
MutableRootQueryImpl
-
方法概要
修饰符和类型方法说明default booleanexists()booleanexists(Connection con) groupBy(Expression<?>... expressions) orderBy(Expression<?>... expressions) default MutableRootQuery<T> default MutableRootQuery<T> orderByIf(boolean condition, Expression<?>... expressions) default MutableRootQuery<T> where(org.babyfish.jimmer.Specification<?> specification) Add some predicates(logical and)where(JSpecification<?, T> specification) default MutableRootQuery<T> Avoid using this method whenever possible, usingDynamic Predicatesare a more convenient approach.default MutableRootQuery<T> 已过时。
-
方法详细资料
-
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
-
where
-
where
-
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
default boolean exists() -
exists
-