Java Reference
In-Depth Information
<isNotEmpty property="x.a" prepend="OR">
a=#x.a#
</isNotEmpty>
<isNotEmpty property="x.b" prepend="OR">
a=#x.b#
</isNotEmpty>
<isNotEmpty property="x.c" prepend="OR">
a=#x.c#
</isNotEmpty>
E Nested dynamic tag
</isNotNull>
</dynamic>
B
At , the opening <dynamic> tag implicitly enforces the remove first prepend func-
tionality on child tags. If this <isNotEmpty> tag proves true , then the implicit
removeFirstPrepend will be met for the <dynamic> tag. Any following tags on the
same level will have their prepend values prepended. This <isNotNull> tag spec-
ifies the removeFirstPrepend attribute. The open and close attribute values will
wrap the content produced in its body. At , the first nested content-producing
<isNotEmpty> tag will satisfy the removeFirstPrepend requirement. The first con-
tent-producing <isNotEmpty> tag will not have its OR prepend value prepended. This
will produce correct SQL wrapped in the parentheses.
The remove first prepend functionality is supported implicitly or explicitly in all of
the tags. The <dynamic> tag supports it implicitly. All other tags support it explic-
itly with the removeFirstPrepend attribute. The remove first prepend functionality
removes the first prepend of a child tag that produces content. If the first content-
producing child does not specify a prepend attribute, it will still count and all fol-
lowing content-producing child tags will have their prepend attribute prefixed to
their content.
The final piece of shared functionality to note is that all tags can be used inde-
pendently of each other. This means that you do not have to nest all of your
Dynamic SQL tags inside the <dynamic> tag. You could start with an <iterate> tag
and nest <isNull> tags inside as easily as you could wrap them both with a <dynamic>
tag. This functionality is provided because it is only necessary to use a <dynamic> tag
when you want to use its open , close , or prepend value on its resulting content.
Let's now analyze each tag category.
C
D
E
Search WWH ::




Custom Search