public abstract class AbstractSelectClauseStateObject extends AbstractStateObject
SELECT clause,
which is either the SELECT clause of the top-level query or of a subquery.AbstractSelectStatementStateObject,
SelectClauseStateObject,
SubQuerySelectClauseStateObject,
AbstractSelectClause| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DISTINCT_PROPERTY
Notifies the distinct property has changed.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSelectClauseStateObject(AbstractSelectStatementStateObject parent)
Creates a new
AbstractSelectClauseStateObject. |
| Modifier and Type | Method and Description |
|---|---|
AbstractSelectClause |
getExpression()
Returns the actual parsed object if this
StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
AbstractFromClauseStateObject |
getFromClause()
Returns the
AbstractFromClauseStateObject representing the FROM clause. |
AbstractSelectStatementStateObject |
getParent()
Returns the parent of this
StateObject. |
boolean |
hasDistinct()
Sets whether the
DISTINCT keyword should be part of the query, which is used to
return only distinct (different) values |
abstract boolean |
hasSelectItem()
Determines whether this
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). |
boolean |
isEquivalent(StateObject stateObject)
Determines whether the given
StateObject is equivalent to this one, i.e. the
information of both StateObject is the same. |
abstract void |
parse(java.lang.String jpqlFragment)
Parses the given JPQL fragment and create the select item.
|
void |
setDistinct(boolean distinct)
Sets whether the
DISTINCT keyword should be part of the query, which is used to
return only distinct (different) values |
void |
toggleDistinct()
Changes the state of the
DISTINCT identifier; either adds it if it's not
present or removes it if it's present. |
acceptUnknownVisitor, acceptUnknownVisitor, addChildren, addProblems, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, findIdentificationVariable, firePropertyChanged, getChangeSupport, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, initialize, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toText, toTextInternalclone, finalize, getClass, notify, notifyAll, wait, wait, waitacceptpublic static final java.lang.String DISTINCT_PROPERTY
protected AbstractSelectClauseStateObject(AbstractSelectStatementStateObject parent)
AbstractSelectClauseStateObject.parent - The parent of this state object, which cannot be nulljava.lang.NullPointerException - The given parent cannot be nullpublic AbstractSelectClause getExpression()
StateObject representation of the JPQL query
was created by parsing an existing JPQL query.getExpression in interface StateObjectgetExpression in class AbstractStateObjectStateObject
or null when the JPQL query is manually created (i.e. not from a string)public AbstractFromClauseStateObject getFromClause()
AbstractFromClauseStateObject representing the FROM clause.public AbstractSelectStatementStateObject getParent()
StateObject.getParent in interface StateObjectgetParent in class AbstractStateObjectStateObject, which is null only when
this is the root of the hierarchypublic boolean hasDistinct()
DISTINCT keyword should be part of the query, which is used to
return only distinct (different) valuesdistinct - true to add DISTINCT to the query in order to have
distinct values; false if it is not requiredpublic abstract boolean hasSelectItem()
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).true if this state object has children; false otherwisepublic boolean isEquivalent(StateObject stateObject)
StateObject is equivalent to this one, i.e. the
information of both StateObject is the same.isEquivalent in interface StateObjectisEquivalent in class AbstractStateObjectstateObject - The StateObject to compare its content to this onetrue if both object are equivalent; false otherwisepublic abstract void parse(java.lang.String jpqlFragment)
jpqlFragment - The portion of the query representing one or several select itemspublic void setDistinct(boolean distinct)
DISTINCT keyword should be part of the query, which is used to
return only distinct (different) valuesdistinct - true to add DISTINCT to the query in order to have
distinct values; false if it is not requiredpublic void toggleDistinct()
DISTINCT identifier; either adds it if it's not
present or removes it if it's present.