- All Superinterfaces:
QueryPart
,Serializable
,Statement
- Enclosing class:
QOM
-
Method Summary
Modifier and TypeMethodDescriptionQOM.UnmodifiableList<? extends QOM.Tuple2<Condition,
Statement>> $arg1()
default QOM.If
$arg1
(QOM.UnmodifiableList<? extends QOM.Tuple2<Condition, Statement>> newArg1) $arg2()
default QOM.If
default @NotNull List<?>
$args()
@NotNull Function2<? super QOM.UnmodifiableList<? extends QOM.Tuple2<Condition,
Statement>>, ? super Statement, ? extends QOM.If> default @Nullable Statement
$else()
default @NotNull QOM.If
default @NotNull QOM.UnmodifiableList<? extends QOM.Tuple2<Condition,
Statement>> $if()
default @NotNull QOM.If
$if
(QOM.UnmodifiableList<? extends QOM.Tuple2<Condition, Statement>> if_) default QueryPart
Traverse aQueryPart
hierarchy and recursively replace its elements by alternatives.default <T> T
-
Method Details
-
$if
-
$if
@CheckReturnValue @NotNull default @NotNull QOM.If $if(QOM.UnmodifiableList<? extends QOM.Tuple2<Condition, Statement>> if_) -
$else
-
$else
-
$arg1
QOM.UnmodifiableList<? extends QOM.Tuple2<Condition,Statement>> $arg1() -
$arg2
Statement $arg2() -
$arg1
@CheckReturnValue @NotNull default QOM.If $arg1(QOM.UnmodifiableList<? extends QOM.Tuple2<Condition, Statement>> newArg1) -
$arg2
-
$constructor
@NotNull @NotNull Function2<? super QOM.UnmodifiableList<? extends QOM.Tuple2<Condition,Statement>>, $constructor()? super Statement, ? extends QOM.If> -
$args
-
$traverse
Description copied from interface:QueryPart
Traverser thisQueryPart
expression tree using a composableTraverser
, producing a result.This offers a generic way to traverse expression trees to translate the tree to arbitrary other data structures. The simplest traversal would just count all the tree elements:
int count = CUSTOMER.NAME.eq(1).$traverse(0, (i, p) -> i + 1);
The same can be achieved by translating the JDK
Collector
API to theTraverser
API usingTraversers.collecting(Collector)
.CUSTOMER.NAME.eq(1).$traverse(Traversers.collecting(Collectors.counting()));
Unlike a
Collector
, aTraverser
is optimised for tree traversal, not stream traversal:- Is not designed for parallelism
- It can
Traverser.abort()
traversal early when the result can be produced early (e.g. when runningTraversers.containing(QueryPart)
, and a result has been found). - It can decide whether to
Traverser.recurse()
into aQueryPart
subtree, or whether that is not necessary or even undesirable, e.g. to prevent entering new subquery scopes. - Unlike a Collector, which can use its
Collector.accumulator()
to accumulate each element only once, in tree traversal, it's desirable to be able to distinguish between accumulating an itemTraverser.before()
orTraverser.after()
recursing into it. This is useful e.g. to wrap each tree node in XML opening and closing tags.
This is a commercial jOOQ edition only feature.
-
$replace
Description copied from interface:QueryPart
-