类 FieldFilterArgsImpl<T extends Table<?>>
java.lang.Object
org.babyfish.jimmer.sql.fetcher.impl.FieldFilterArgsImpl<T>
- 所有已实现的接口:
Filterable,Sortable,SubQueryProvider,FieldFilterArgs<T>,FieldFilterArgsImplementor<T>
public class FieldFilterArgsImpl<T extends Table<?>>
extends Object
implements FieldFilterArgsImplementor<T>
-
方法概要
修饰符和类型方法说明<SE,ST extends TableEx<SE>, TE, TT extends TableEx<TE>>
MutableSubQuerycreateAssociationSubQuery(AssociationTable<SE, ST, TE, TT> table) createSubQuery(TableProxy<?> table) <K> KgetKey()<K> Collection<K> getKeys()getTable()booleanisSorted()static <T extends Table<?>>
FieldFilterArgsImpl<T> of(AbstractMutableQueryImpl query, T table, Collection<Object> keys) orderBy(Expression<?>... expressions) query()Add some predicates(logical and)Avoid using this method whenever possible, usingDynamic Predicatesare a more convenient approach.已过时。
-
方法详细资料
-
of
public static <T extends Table<?>> FieldFilterArgsImpl<T> of(AbstractMutableQueryImpl query, T table, Collection<Object> keys) -
isSorted
public boolean isSorted() -
getTable
- 指定者:
getTable在接口中FieldFilterArgs<T extends Table<?>>
-
getKey
public <K> K getKey()- 指定者:
getKey在接口中FieldFilterArgs<T extends Table<?>>
-
getKeys
- 指定者:
getKeys在接口中FieldFilterArgs<T extends Table<?>>
-
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
-
orderBy
-
createSubQuery
- 指定者:
createSubQuery在接口中SubQueryProvider
-
createAssociationSubQuery
public <SE,ST extends TableEx<SE>, MutableSubQuery createAssociationSubQueryTE, TT extends TableEx<TE>> (AssociationTable<SE, ST, TE, TT> table) - 指定者:
createAssociationSubQuery在接口中SubQueryProvider
-
query
- 指定者:
query在接口中FieldFilterArgsImplementor<T extends Table<?>>
-