接口 Sortable
- 所有超级接口:
Filterable
- 所有已知子接口:
FieldFilterArgs<T>,FieldFilterArgsImplementor<T>,FilterArgs<P>,MutableQuery,MutableRootQuery<T>,MutableSubQuery
- 所有已知实现类:
AbstractMutableQueryImpl,FieldFilterArgsImpl,FilterArgsImpl,MutableRootQueryImpl,MutableSubQueryImpl
-
方法概要
修饰符和类型方法说明orderBy(Expression<?>... expressions) default Sortabledefault SortableorderByIf(boolean condition, Expression<?>... expressions) default SortableAdd some predicates(logical and)default SortableAvoid using this method whenever possible, usingDynamic Predicatesare a more convenient approach.default Sortable已过时。
-
方法详细资料
-
where
从接口复制的说明:FilterableAdd some predicates(logical and)- 指定者:
where在接口中Filterable- 参数:
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
从接口复制的说明: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- 参数:
condition- The conditionblock- A lambda to create predicate when condition is true- 返回:
- Return the current object to support chain programming style
-
orderBy
-
orderByIf
-
orderBy
-
orderByIf
-
orderBy
-
orderByIf
-