CASE predicate is used to calculate a condition and when it's true,
its THEN expression will be executed.
general_case_expression ::= CASE when_clause {when_clause}* ELSE scalar_expression ENDBNF: simple_case_expression ::= CASE case_operand simple_when_clause {simple_when_clause}* ELSE scalar_expression END
WhenClauseStateObject, CaseExpression
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CASE_OPERAND_STATE_OBJECT_PROPERTY
Notify the |
| private StateObject | caseOperandStateObject
The |
| public static final String | ELSE_STATE_OBJECT_PROPERTY
Notify the |
| private StateObject | elseStateObject
The |
| public static final String | WHEN_CLAUSE_STATE_OBJECT_LIST
Notify the list of |
| Access | Constructor and Description |
|---|---|
| public | CaseExpressionStateObject(StateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | CaseExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, List<WhenClauseStateObject> nullThe list of whenClauseStateObjects, StateObject WhenClauseStateObjects
that are representing the WHEN clausesThe elseStateObject)StateObject representing the scalar expression that is
following the ELSE identifierCreates a new |
| public | CaseExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe caseOperandStateObject, List<WhenClauseStateObject> StateObject representing the case operand that is
following the CASE identifier or null if none is declaredThe list of whenClauseStateObjects, StateObject WhenClauseStateObjects
that are representing the WHEN clausesThe elseStateObject)StateObject representing the scalar expression that is
following the ELSE identifierCreates 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 WhenClauseStateObject | |
| public WhenClauseStateObject | Returns: The newly createdWhenClauseStateObjectThe whenStateObject, StateObject StateObject representing the WHEN
expressionThe thenStateObject)StateObject representing the THEN
expressionAdds the given two |
| public WhenClauseStateObject | Returns: The newly createdWhenClauseStateObjectThe string representation of the whenJpqlFragment, String WHEN to parse and
to convert into a StateObject representationThe string representation of the thenJpqlFragment)THEN to parse and
to convert into a StateObject representationAdds the given two |
| public StateObject | |
| public StateObject | |
| public CaseExpression | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public boolean | Returns: true the case operand exists; otherwise falseDetermines whether the |
| public boolean | Returns: true the ELSE 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.
|
| protected String | listName()
Implements abstract org. |
| public void | parseCaseOperand(String
The string representation of the case operand to parse and to convert into
a jpqlFragment)StateObject representationParses the given JPQL fragment, which will represent the case operand. |
| public void | parseElse(String
The string representation of the jpqlFragment)ELSE to parse and to
convert into a StateObject representationParses the given JPQL fragment, which will represent the |
| public void | |
| public void | setCaseOperand(StateObject
The caseOperand)StateObject representing the case operand or
null to remove itSets the case operand to be the given |
| public void | |
| public void | setExpression(CaseExpression
The expression)parsed object representing a CASE
expressionKeeps a reference of the |
| public void | toTextInternal(Appendable
The writer used to print out the string representation writer)Implements abstract org. StateObject, which should not be used to
define a true string representation of a JPQL query but should be used for
debugging purposes.
|
| CASE_OPERAND_STATE_OBJECT_PROPERTY | back to summary |
|---|---|
| public static final String CASE_OPERAND_STATE_OBJECT_PROPERTY Notify the | |
| caseOperandStateObject | back to summary |
|---|---|
| private StateObject caseOperandStateObject The | |
| ELSE_STATE_OBJECT_PROPERTY | back to summary |
|---|---|
| public static final String ELSE_STATE_OBJECT_PROPERTY Notify the | |
| elseStateObject | back to summary |
|---|---|
| private StateObject elseStateObject The | |
| WHEN_CLAUSE_STATE_OBJECT_LIST | back to summary |
|---|---|
| public static final String WHEN_CLAUSE_STATE_OBJECT_LIST Notify the list of | |
| CaseExpressionStateObject | back to summary |
|---|---|
| public CaseExpressionStateObject(StateObject parent) Creates a new
| |
| CaseExpressionStateObject | back to summary |
|---|---|
| public CaseExpressionStateObject(StateObject parent, List<WhenClauseStateObject> whenClauseStateObjects, StateObject elseStateObject) Creates a new
| |
| CaseExpressionStateObject | back to summary |
|---|---|
| public CaseExpressionStateObject(StateObject parent, StateObject caseOperandStateObject, List<WhenClauseStateObject> whenClauseStateObjects, StateObject elseStateObject) 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 | |
| addWhenClause | back to summary |
|---|---|
| public WhenClauseStateObject addWhenClause() Adds a new
| |
| addWhenClause | back to summary |
|---|---|
| public WhenClauseStateObject addWhenClause(StateObject whenStateObject, StateObject thenStateObject) Adds the given two
| |
| addWhenClause | back to summary |
|---|---|
| public WhenClauseStateObject addWhenClause(String whenJpqlFragment, String thenJpqlFragment) Adds the given two
| |
| getCaseOperand | back to summary |
|---|---|
| public StateObject getCaseOperand() Returns the
| |
| getElse | back to summary |
|---|---|
| public StateObject getElse() Returns the
| |
| getExpression | back to summary |
|---|---|
| public CaseExpression getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| hasCaseOperand | back to summary |
|---|---|
| public boolean hasCaseOperand() Determines whether the
| |
| hasElse | back to summary |
|---|---|
| public boolean hasElse() Determines whether the
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| listName | back to summary |
|---|---|
| protected String listName() Implements abstract org. Doc from org. Returns the name that is uniquely identifying the list. | |
| parseCaseOperand | back to summary |
|---|---|
| public void parseCaseOperand(String jpqlFragment) Parses the given JPQL fragment, which will represent the case operand. The JPQL fragment should not start with the identifier.
| |
| parseElse | back to summary |
|---|---|
| public void parseElse(String jpqlFragment) Parses the given JPQL fragment, which will represent the
| |
| removeCaseOperand | back to summary |
|---|---|
| public void removeCaseOperand() Removes the case operand. | |
| setCaseOperand | back to summary |
|---|---|
| public void setCaseOperand(StateObject caseOperand) Sets the case operand to be the given
| |
| setElse | back to summary |
|---|---|
| public void setElse(StateObject elseStateObject) Sets the
| |
| setExpression | back to summary |
|---|---|
| public void setExpression(CaseExpression expression) Keeps a reference of the
| |
| toTextInternal | back to summary |
|---|---|
| public void toTextInternal(Appendable writer) throws IOException Implements abstract org. Doc from org. Prints out a string representation of this
| |