SELECT statement queries data from entities, which determines the type of
the objects or values to be selected.
BNF: select_clause ::= SELECT [DISTINCT] select_expression {, select_expression}*
select_expression ::= single_valued_path_expression |
aggregate_expression |
identification_variable |
OBJECT(identification_variable) |
constructor_expression
SelectStatementStateObject, SelectClause
| Modifier and Type | Field and Description |
|---|---|
| private ISelectExpressionStateObjectBuilder | builder
The builder is cached during the creation of the select expression. |
| private List | items
The list of select expressions. |
| public static final String | SELECT_ITEMS_LIST
A constant used to notify the list of select expressions has changed. |
| Access | Constructor and Description |
|---|---|
| public | SelectClauseStateObject(SelectStatementStateObject
The parent of this state object, which cannot be parent)nullCreates 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 ResultVariableStateObject | Returns: The newly createdResultVariableStateObjectThe stateObject, String StateObject representing the select expressionThe result variable identifying the select expression resultVariable)Adds the given |
| public StateObject | Returns: TheStateObject encapsulating the given pathThe select expression to parse as a select item jpqlFragment)Implements org. |
| public ResultVariableStateObject | Returns: The newly createdResultVariableStateObjectThe select expression to parse as a select item jpqlFragment, String The result variable identifying the select expression resultVariable)Adds the given expression as a select item. |
| public <S extends StateObject> S | addItem(S
The child item)StateObject to become a child of this one
return The given itemImplements org. StateObject as a child of this one.
|
| public ResultVariableStateObject | Returns: The newly createdResultVariableStateObjectThe stateObject, String StateObject representing the select expressionThe result variable identifying the select expression resultVariable)Adds the given |
| public ResultVariableStateObject | Returns: The newly createdResultVariableStateObjectThe portion of a JPQL query that represents a select expression jpqlFragment, String The result variable identifying the select expression resultVariable)Adds the given JPQL fragment as a select item. |
| public void | addItems(List<? extends StateObject>
The items)StateObjects to become children of this oneImplements org. StateObjects as children of this one.
|
| public void | addListChangeListener(String
The name of the list for which the listener will be notified when the content
of the list has changed listName, IListChangeListener<StateObject> The listener to be notified upon changes listener)Implements org. IListChangeListener for the specified list.
|
| protected boolean | Returns: true if both have equivalent children; false otherwiseThe stateObject)StateObject to compare its children to this one's childrenDetermines whether the children of this |
| public boolean | canMoveDown(StateObject
The item)StateObject that could potentially be moved downImplements org. StateObject can be moved down by one position in the
list owned by its parent.
|
| public boolean | canMoveUp(StateObject
The item)StateObject that could potentially be moved upImplements org. StateObject can be moved up by one position in the list
owned by its parent.
|
| public ISelectExpressionStateObjectBuilder | Returns: A new builder that can be used to quickly create a select expressionCreates and returns a new |
| public SelectClause | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public FromClauseStateObject | getFromClause()
Overrides org. AbstractFromClauseStateObject representing the FROM clause.
|
| public StateObject | getItem(int
The position of the index)StateObject to retrieveImplements org. StateObject at the given positions from the list
|
| public SelectStatementStateObject | getParent()
Overrides org. Implements org. StateObject.
|
| public boolean | hasItems()
Implements org. StateObject has any children.
|
| public boolean | hasSelectItem()
Implements abstract org. SELECT clause has a select item defined (only one
can be set for a subquery's SELECT clause and many for a top-level query).
|
| protected void | initialize()
Overrides org. |
| 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 ListIterable | items()
Implements org. ListIterable over the children.
|
| public int | itemsSize()
Implements org. |
| public StateObject | moveDown(StateObject
The item)StateObject to move down in the listImplements org. StateObject down by one position in the list owned by its parent.
|
| public StateObject | moveUp(StateObject
The item)StateObject to move up in the listImplements org. StateObject up by one position in the list owned by its parent.
|
| public void | parse(String
The portion of the query representing one or several select items jpqlFragment)Implements abstract org. |
| public void | removeItem(StateObject
The child stateObject)StateObject to not longer be a childImplements org. StateObject from the list of children.
|
| public void | removeItems(Collection<StateObject>
The items)StateObjects to remove from this oneImplements org. StateObject from the list of children.
|
| public void | removeListChangeListener(String
The name of the list for which the listener was registered listName, IListChangeListener<StateObject> The listener to unregister listener)Implements org. IListChangeListener that was registered for the specified list.
|
| public void | setExpression(SelectClause
The expression)parsed object representing a SELECT
clauseKeeps a reference of the |
| public void | setItems(List<StateObject>
The new select expressions stateObjects)Sets the select expression to be those contained on the given collection. |
| 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.
|
| builder | back to summary |
|---|---|
| private ISelectExpressionStateObjectBuilder builder The builder is cached during the creation of the select expression. | |
| items | back to summary |
|---|---|
| private List<StateObject> items The list of select expressions. | |
| SELECT_ITEMS_LIST | back to summary |
|---|---|
| public static final String SELECT_ITEMS_LIST A constant used to notify the list of select expressions has changed. | |
| SelectClauseStateObject | back to summary |
|---|---|
| public SelectClauseStateObject(SelectStatementStateObject parent) 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
| |
| addItem | back to summary |
|---|---|
| public ResultVariableStateObject addItem(StateObject stateObject, String resultVariable) Adds the given
| |
| addItem | back to summary |
|---|---|
| public StateObject addItem(String jpqlFragment) Implements org. Adds the given path as a select item, which can either be an identification variable or a state-field path expression.
| |
| addItem | back to summary |
|---|---|
| public ResultVariableStateObject addItem(String jpqlFragment, String resultVariable) Adds the given expression as a select item.
| |
| addItem | back to summary |
|---|---|
| public <S extends StateObject> S addItem(S item) Implements org. Doc from org. Adds the given
| |
| addItemAs | back to summary |
|---|---|
| public ResultVariableStateObject addItemAs(StateObject stateObject, String resultVariable) Adds the given
| |
| addItemAs | back to summary |
|---|---|
| public ResultVariableStateObject addItemAs(String jpqlFragment, String resultVariable) Adds the given JPQL fragment as a select item.
| |
| addItems | back to summary |
|---|---|
| public void addItems(List<? extends StateObject> items) Implements org. Doc from org. Adds the given list of
| |
| addListChangeListener | back to summary |
|---|---|
| public void addListChangeListener(String listName, IListChangeListener<StateObject> listener) Implements org. Doc from org. Registers the given
| |
| areChildrenEquivalent | back to summary |
|---|---|
| protected boolean areChildrenEquivalent(SelectClauseStateObject stateObject) Determines whether the children of this
| |
| canMoveDown | back to summary |
|---|---|
| public boolean canMoveDown(StateObject item) Implements org. Doc from org. Determines whether the given
| |
| canMoveUp | back to summary |
|---|---|
| public boolean canMoveUp(StateObject item) Implements org. Doc from org. Determines whether the given
| |
| getBuilder | back to summary |
|---|---|
| public ISelectExpressionStateObjectBuilder getBuilder() Creates and returns a new
| |
| getExpression | back to summary |
|---|---|
| public SelectClause getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getFromClause | back to summary |
|---|---|
| public FromClauseStateObject getFromClause() Overrides org. Doc from org. Returns the
| |
| getItem | back to summary |
|---|---|
| public StateObject getItem(int index) Implements org. Doc from org. Returns the
| |
| getParent | back to summary |
|---|---|
| public SelectStatementStateObject getParent() Overrides org. Implements org. Doc from org. Returns the parent of this
| |
| hasItems | back to summary |
|---|---|
| public boolean hasItems() Implements org. Doc from org. Determines whether this
| |
| hasSelectItem | back to summary |
|---|---|
| public boolean hasSelectItem() Implements abstract org. Doc from org. Determines whether this
| |
| initialize | back to summary |
|---|---|
| protected void initialize() Overrides org. Doc from org. Initializes this state object.
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| items | back to summary |
|---|---|
| public ListIterable Implements org. Doc from org. Returns an
| |
| itemsSize | back to summary |
|---|---|
| public int itemsSize() Implements org. Doc from org. Returns the number of children this list holder has.
| |
| moveDown | back to summary |
|---|---|
| public StateObject moveDown(StateObject item) Implements org. Doc from org. Moves the given
| |
| moveUp | back to summary |
|---|---|
| public StateObject moveUp(StateObject item) Implements org. Doc from org. Moves the given
| |
| parse | back to summary |
|---|---|
| public void parse(String jpqlFragment) Implements abstract org. Doc from org. Parses the given JPQL fragment and create the select item. For the top-level query, the fragment can contain several select items but for a subquery, it can represent only one. | |
| removeItem | back to summary |
|---|---|
| public void removeItem(StateObject stateObject) Implements org. Doc from org. Removes the given
| |
| removeItems | back to summary |
|---|---|
| public void removeItems(Collection<StateObject> items) Implements org. Doc from org. Removes the given
| |
| removeListChangeListener | back to summary |
|---|---|
| public void removeListChangeListener(String listName, IListChangeListener<StateObject> listener) Implements org. Doc from org. Unregisters the given
| |
| setExpression | back to summary |
|---|---|
| public void setExpression(SelectClause expression) Keeps a reference of the
| |
| setItems | back to summary |
|---|---|
| public void setItems(List<StateObject> stateObjects) Sets the select expression to be those contained on the given collection. If any select items were already set, they will be removed.
| |
| toTextInternal | back to summary |
|---|---|
| protected void toTextInternal(Appendable writer) throws IOException Implements abstract org. Doc from org. Prints out a string representation of this
| |