WHEN predicate is used to calculate a condition and when it's true, its
THEN will be executed.
BNF: when_clause ::= WHEN conditional_expression THEN scalar_expression
BNF: simple_when_clause ::= WHEN scalar_expression THEN scalar_expression
WhenClause
| Modifier and Type | Field and Description |
|---|---|
| public static final String | THEN_STATE_OBJECT_PROPERTY
Notify the |
| private StateObject | thenStateObject
The |
| Access | Constructor and Description |
|---|---|
| public | WhenClauseStateObject(CaseExpressionStateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | WhenClauseStateObject(CaseExpressionStateObject
The parent of this state object parent, StateObject The whenStateObject, StateObject StateObject representing the conditional expression that
is following the WHEN identifierThe thenStateObject)StateObject representing the scalar expression that
is following the THEN identifierCreates a new |
| public | WhenClauseStateObject(CaseExpressionStateObject
The parent of this state object parent, String The string representation of the whenJpqlFragment, String WHEN clause to
parse and to convert into a StateObjectThe string representation of the thenJpqlFragment)THEN expression
to parse and to convert into a StateObjectCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| protected void | addChildren(List<StateObject>
The list used to store the children children)Overrides org. StateObject to the given list.
|
| protected void | addProblems(List<Problem>
The list to which the problems are added problems)Overrides org. StateObject, which means there are validation issues.
|
| public WhenClause | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public String | getIdentifier()
Implements abstract org. |
| public CaseExpressionStateObject | getParent()
Overrides org. Implements org. StateObject.
|
| public StateObject | getThen()
Returns the |
| public boolean | Returns: true the scalar expression exists; otherwise falseDetermines whether the |
| public boolean | isEquivalent(StateObject
The stateObject)StateObject to compare its content to this oneOverrides org. Implements org. StateObject is equivalent to this one, i.e. the
information of both StateObject is the same.
|
| public void | parseThen(String
The string representation of the jpqlFragment)THEN expression
to parse and to convert into a StateObjectParses the given JPQL fragment, which will represent the |
| public void | parseWhen(String
The string representation of the jpqlFragment)WHEN clause to
parse and to convert into a StateObjectParses the given JPQL fragment, which will represent the |
| public void | setExpression(WhenClause
The expression)parsed object representing a WHEN
clauseKeeps a reference of the |
| public void | setThen(StateObject
The thenStateObject)StateObject representing the scalar expressionSets the scalar expression to be the given |
| public void | toTextInternal(Appendable
The writer used to print out the string representation writer)
Prints out a string representation of this StateObject, which should not be used to
define a true string representation of a JPQL query but should be used for
debugging purposes.
|
| THEN_STATE_OBJECT_PROPERTY | back to summary |
|---|---|
| public static final String THEN_STATE_OBJECT_PROPERTY Notify the | |
| thenStateObject | back to summary |
|---|---|
| private StateObject thenStateObject The | |
| WhenClauseStateObject | back to summary |
|---|---|
| public WhenClauseStateObject(CaseExpressionStateObject parent) Creates a new
| |
| WhenClauseStateObject | back to summary |
|---|---|
| public WhenClauseStateObject(CaseExpressionStateObject parent, StateObject whenStateObject, StateObject thenStateObject) Creates a new
| |
| WhenClauseStateObject | back to summary |
|---|---|
| public WhenClauseStateObject(CaseExpressionStateObject parent, String whenJpqlFragment, String thenJpqlFragment) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| addChildren | back to summary |
|---|---|
| protected void addChildren(List<StateObject> children) Overrides org. Doc from org. Adds the children of this
| |
| addProblems | back to summary |
|---|---|
| protected void addProblems(List<Problem> problems) Overrides org. Doc from org. Adds to the given list the problems that were found with the current state of this | |
| getExpression | back to summary |
|---|---|
| public WhenClause getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getIdentifier | back to summary |
|---|---|
| public String getIdentifier() Implements abstract org. Returns the JPQL identifier of this clause. | |
| getParent | back to summary |
|---|---|
| public CaseExpressionStateObject getParent() Overrides org. Implements org. Doc from org. Returns the parent of this
| |
| getThen | back to summary |
|---|---|
| public StateObject getThen() Returns the
| |
| hasThen | back to summary |
|---|---|
| public boolean hasThen() Determines whether the
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| parseThen | back to summary |
|---|---|
| public void parseThen(String jpqlFragment) Parses the given JPQL fragment, which will represent the
| |
| parseWhen | back to summary |
|---|---|
| public void parseWhen(String jpqlFragment) Parses the given JPQL fragment, which will represent the
| |
| setExpression | back to summary |
|---|---|
| public void setExpression(WhenClause expression) Keeps a reference of the
| |
| setThen | back to summary |
|---|---|
| public void setThen(StateObject thenStateObject) Sets the scalar expression to be the given
| |
| toTextInternal | back to summary |
|---|---|
| public void toTextInternal(Appendable writer) throws IOException Doc from org. Prints out a string representation of this
| |