类 SpecificationArgs<E,T extends Table<E>>
java.lang.Object
org.babyfish.jimmer.sql.ast.query.specification.SpecificationArgs<E,T>
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<XE,XT extends Table<XE>>
SpecificationArgs<XE, XT> child()<SE,ST extends TableEx<SE>, TE, TT extends TableEx<TE>>
MutableSubQuerycreateAssociationSubQuery(AssociationTable<SE, ST, TE, TT> table) createSubQuery(TableProxy<?> table) getTable()已过时。
-
构造器详细资料
-
SpecificationArgs
-
-
方法详细资料
-
getTable
-
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
-
createSubQuery
-
createAssociationSubQuery
public <SE,ST extends TableEx<SE>, MutableSubQuery createAssociationSubQueryTE, TT extends TableEx<TE>> (AssociationTable<SE, ST, TE, TT> table) -
getApplier
-
child
-