接口 MutableDelete
- 所有超级接口:
Executable<Integer>,Filterable
- 所有已知实现类:
MutableDeleteImpl
-
方法概要
修饰符和类型方法说明setMode(DeleteMode mode) Add some predicates(logical and)default MutableDeleteAvoid using this method whenever possible, usingDynamic Predicatesare a more convenient approach.default MutableDelete已过时。从接口继承的方法 org.babyfish.jimmer.sql.ast.Executable
execute, execute
-
方法详细资料
-
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
已过时。从接口复制的说明:FilterableThis 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
-
disableDissociation
MutableDelete disableDissociation() -
setMode
-