public class FQLExpression
extends java.lang.Object
FQLExpression fql = new FQLExpression("where ");
fql.append("a = ", true);
fql.append(" and b");
fql.append(' = ", true);
fql.toFinalExpression; -> "where a = ?0 and b = ?1"
| Modifier and Type | Field and Description |
|---|---|
private boolean |
endsWithSubst
true if the FQL expression ends with a substitution. |
private boolean |
hasLastPart
Flag indicating if
lastPart is used. |
private java.lang.StringBuilder |
lastPart
String builder to speed up sequential concatenations.
|
private boolean |
multiplexed
By default, FQL expressions, including the empty ones are not (yet) multiplexed.
|
private java.util.List<java.lang.String> |
parts
Parts of the FQL expression separated by substitutions.
|
| Constructor and Description |
|---|
FQLExpression()
Create an empty FQL expression.
|
FQLExpression(FQLExpression starting)
Create an FQL expression starting with the specified sub-expression.
|
FQLExpression(java.lang.String starting)
Create an FQL expression starting with the specified sub-expression.
|
FQLExpression(java.lang.String starting,
boolean endsWithSubst)
Create an FQL expression starting with the specified sub-expression.
|
| Modifier and Type | Method and Description |
|---|---|
FQLExpression |
append(FQLExpression subExpression)
Append the expression with the specified sub-expression.
|
FQLExpression |
append(java.lang.String subExpression)
Append the expression with the specified sub-expression.
|
FQLExpression |
append(java.lang.String subExpression,
boolean endsWithSubst)
Append the expression with the specified sub-expression.
|
boolean |
isEmpty()
If this expression is empty.
|
void |
setMultiplexed(boolean multiplexed)
Sets the expression's multiplexed property.
|
java.lang.String |
toFinalExpression()
Returns the final form of the FQL expression with placeholders emitted.
|
java.lang.String |
toFinalExpression(boolean jpaStyle)
Returns the final form of the FQL expression with placeholders emitted.
|
java.lang.String |
toString()
Returns the string representation of this expression.
|
FQLExpression |
trim()
Trim the expression.
|
boolean |
wasMultiplexed()
Test whether the multiplex check was added to this expression.
|
private void |
writeLastPart()
|
private java.util.List<java.lang.String> parts
private boolean endsWithSubst
true if the FQL expression ends with a substitution.private java.lang.StringBuilder lastPart
null or contain
the last part for parts.private boolean hasLastPart
lastPart is used.private boolean multiplexed
public FQLExpression()
public FQLExpression(FQLExpression starting)
starting - Staring sub-expression.public FQLExpression(java.lang.String starting)
starting - Staring sub-expression.public FQLExpression(java.lang.String starting,
boolean endsWithSubst)
starting - Staring sub-expression.endsWithSubst - true if the starting sub-expression ends with a substitution.public FQLExpression append(java.lang.String subExpression)
subExpression - Sub-expression to append.public FQLExpression append(java.lang.String subExpression, boolean endsWithSubst)
subExpression - Sub-expression to append.endsWithSubst - true if the appended sub-expression ends with a substitution.public FQLExpression append(FQLExpression subExpression)
subExpression - Sub-expression to append.public java.lang.String toFinalExpression()
public java.lang.String toFinalExpression(boolean jpaStyle)
jpsStyle is
true; otherwise, simple substitution placeholders (i.e., ?) are emitted.jpaStyle - true to emit JPA-style positional parameter placeholders;
false to emit simple placeholders.public boolean isEmpty()
true if this expression is empty.public FQLExpression trim()
public java.lang.String toString()
toString in class java.lang.Objectprivate void writeLastPart()
public boolean wasMultiplexed()
true if this expression was marked as multiplexed after the condition was added.public void setMultiplexed(boolean multiplexed)
true
parameter, after adding the multiplex check condition to expression. The opposite would be useful if the
expression is cleared, but this feature is not currently available.multiplexed - The new value of the property.