ORDER BY item must be one of the following:
state_field_path_expression that evaluates to
an orderable state field of an entity or embeddable class abstract schema type designated in the
SELECT clause by one of the following:
state_field_path_expression that evaluates to
the same state field of the same entity or embeddable abstract schema type as a state_field_path_expression in the SELECT clause
result_variable that refers to an orderable item in the
SELECT clause for which the same result_variable
has been specified. This may be the result of an aggregate_expression, a scalar_expression,
or a state_field_path_expression in the
SELECT clause.
The keyword ASC specifies that ascending ordering be used for the associated
ORDER BY item; the keyword DESC specifies that descending
ordering be used. Ascending ordering is the default.
JPA 1.0:
orderby_item ::= state_field_path_expression [ ASC | DESC ]BNF: orderby_item ::= state_field_path_expression | result_variable [ ASC | DESC ]
OrderByItem
| Modifier and Type | Field and Description |
|---|---|
| private OrderByItem. | ordering
The ascending ordering. |
| public static final String | ORDERING_PROPERTY
Notifies the ordering property has changed. |
| public static final String | STATE_OBJECT_PROPERTY
Notifies the ordering property has changed. |
| private StateObject | stateObject
The |
| Access | Constructor and Description |
|---|---|
| public | OrderByItemStateObject(OrderByClauseStateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | OrderByItemStateObject(OrderByClauseStateObject
The parent of this state object, which cannot be parent, OrderByItem.nullCreates a new |
| public | OrderByItemStateObject(OrderByClauseStateObject
The parent of this state object, which cannot be parent, StateObject nullThe stateObject, OrderByItem.StateObject of the itemOne of the possible orderingOrdering choiceCreates a new |
| public | OrderByItemStateObject(OrderByClauseStateObject
The parent of this state object, which cannot be parent, String nullThe JPQL fragment representing the ordering item jpqlFragment, OrderByItem.One of the possible orderingOrdering choiceCreates 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.
|
| public OrderByItem | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public OrderByItem. | Returns: The constant representing the ordering, in the case the ordering was not parsed, thenOrdering#DEFAULT is returnedReturns the enum constant representing the ordering type. |
| public OrderByClauseStateObject | getParent()
Overrides org. Implements org. StateObject.
|
| public StateObject | Returns: TheStateObject representing the value used for orderingReturns the |
| public boolean | Returns: true if the ordering value is defined; false otherwiseDetermines whether the |
| public boolean | Returns: true if ASC was parsed; false otherwiseDetermines whether the ordering was specified as being ascendant. |
| public boolean | Returns: true if no ordering was parsed; false otherwiseDetermines whether the ordering was not specified. |
| public boolean | Returns: true if DESC was parsed; false otherwiseDetermines whether the ordering was specified as being descendant. |
| 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 | parse(String
The portion of the query representing a state-field path expression or
result variable jpqlFragment)Parses the given JPQL fragment, which represents either a state-field pathe expression or a
result variable, and creates the |
| public void | |
| public void | setExpression(OrderByItem
The expression)parsed object representing an order by itemKeeps a reference of the |
| public void | setOrdering(OrderByItem.
The constant representing the ordering, in the case the ordering was not
parsed, then orderingOrdering#DEFAULT should be usedSets the enum constant representing the ordering type. |
| public void | setStateObject(StateObject
The stateObject)StateObject representing the value used for orderingSets the |
| protected 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.
|
| private void |
| ordering | back to summary |
|---|---|
| private OrderByItem. The ascending ordering. | |
| ORDERING_PROPERTY | back to summary |
|---|---|
| public static final String ORDERING_PROPERTY Notifies the ordering property has changed. | |
| STATE_OBJECT_PROPERTY | back to summary |
|---|---|
| public static final String STATE_OBJECT_PROPERTY Notifies the ordering property has changed. | |
| stateObject | back to summary |
|---|---|
| private StateObject stateObject The | |
| OrderByItemStateObject | back to summary |
|---|---|
| public OrderByItemStateObject(OrderByClauseStateObject parent) Creates a new
| |
| OrderByItemStateObject | back to summary |
|---|---|
| public OrderByItemStateObject(OrderByClauseStateObject parent, OrderByItem. Creates a new
| |
| OrderByItemStateObject | back to summary |
|---|---|
| public OrderByItemStateObject(OrderByClauseStateObject parent, StateObject stateObject, OrderByItem. Creates a new
| |
| OrderByItemStateObject | back to summary |
|---|---|
| public OrderByItemStateObject(OrderByClauseStateObject parent, String jpqlFragment, OrderByItem. 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
| |
| getExpression | back to summary |
|---|---|
| public OrderByItem getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getOrdering | back to summary |
|---|---|
| public OrderByItem. Returns the enum constant representing the ordering type.
| |
| getParent | back to summary |
|---|---|
| public OrderByClauseStateObject getParent() Overrides org. Implements org. Doc from org. Returns the parent of this
| |
| getStateObject | back to summary |
|---|---|
| public StateObject getStateObject() Returns the
| |
| hasStateObject | back to summary |
|---|---|
| public boolean hasStateObject() Determines whether the
| |
| isAscending | back to summary |
|---|---|
| public boolean isAscending() Determines whether the ordering was specified as being ascendant.
| |
| isDefault | back to summary |
|---|---|
| public boolean isDefault() Determines whether the ordering was not specified.
| |
| isDescending | back to summary |
|---|---|
| public boolean isDescending() Determines whether the ordering was specified as being descendant.
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| parse | back to summary |
|---|---|
| public void parse(String jpqlFragment) Parses the given JPQL fragment, which represents either a state-field pathe expression or a
result variable, and creates the
| |
| removeOrdering | back to summary |
|---|---|
| public void removeOrdering() Removes the ordering if it's specified, otherwise do nothing. | |
| setExpression | back to summary |
|---|---|
| public void setExpression(OrderByItem expression) Keeps a reference of the
| |
| setOrdering | back to summary |
|---|---|
| public void setOrdering(OrderByItem. Sets the enum constant representing the ordering type.
| |
| setStateObject | back to summary |
|---|---|
| public void setStateObject(StateObject stateObject) Sets the
| |
| toTextInternal | back to summary |
|---|---|
| protected void toTextInternal(Appendable writer) throws IOException Implements abstract org. Doc from org. Prints out a string representation of this
| |
| validateOrdering | back to summary |
|---|---|
| private void validateOrdering(OrderByItem. | |