public class SimpleSelectStatementStateObject extends AbstractSelectStatementStateObject
SELECT
clause
and a FROM
clause. The other clauses are optional.
BNF: subquery ::= simple_select_clause subquery_from_clause [where_clause] [groupby_clause] [having_clause]
SimpleSelectStatement
GROUP_BY_CLAUSE_PROPERTY, HAVING_CLAUSE_PROPERTY, WHERE_CLAUSE_PROPERTY
Constructor and Description |
---|
SimpleSelectStatementStateObject(StateObject parent)
Creates a new
SimpleSelectStatementStateObject . |
Modifier and Type | Method and Description |
---|---|
void |
accept(StateObjectVisitor visitor)
Visits this
StateObject by the given visitor . |
CollectionMemberDeclarationStateObject |
addDerivedCollectionDeclaration()
Adds a new derived collection declaration to the
FROM clause. |
CollectionMemberDeclarationStateObject |
addDerivedCollectionDeclaration(java.lang.String collectionValuedPath)
Adds a new derived collection declaration to the
FROM clause. |
DerivedPathIdentificationVariableDeclarationStateObject |
addDerivedPathDeclaration()
Adds a new derived identification variable declaration to the
FROM clause. |
DerivedPathIdentificationVariableDeclarationStateObject |
addDerivedPathDeclaration(java.lang.String path,
java.lang.String identificationVariable)
Adds a new derived identification variable declaration to the
FROM clause. |
protected AbstractFromClauseStateObject |
buildFromClause()
Creates the state object representing the
FROM clause. |
protected AbstractSelectClauseStateObject |
buildSelectClause()
Creates the state object representing the
SELECT clause. |
SimpleSelectStatement |
getExpression()
Returns the actual parsed object if this
StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
SimpleFromClauseStateObject |
getFromClause()
Returns the state object representing the
FROM clause. |
ISimpleSelectExpressionStateObjectBuilder |
getSelectBuilder()
Creates and returns a new
ISimpleSelectExpressionStateObjectBuilder that can be used
to programmatically create a single select expression and once the expression is complete,
ISimpleSelectExpressionStateObjectBuilder.commit() will push the StateObject
representation of that expression as this clause's select expression. |
SimpleSelectClauseStateObject |
getSelectClause()
Returns the state object representing the
SELECT clause. |
void |
setExpression(SimpleSelectStatement expression)
Keeps a reference of the
parsed object object, which should only
be done when this object is instantiated during the conversion of a parsed JPQL query into
StateObjects . |
void |
setSelectItem(StateObject stateObject)
Sets the given
StateObject as the SELECT clause's select item. |
void |
setSelectItem(java.lang.String jpqlFragment)
Parses the given JPQL fragment and create the select item.
|
addChildren, addCollectionDeclaration, addCollectionDeclaration, addGroupByClause, addGroupByClause, addHavingClause, addHavingClause, addRangeDeclaration, addRangeDeclaration, addRangeDeclaration, addWhereClause, addWhereClause, declarations, findIdentificationVariable, getDeclaration, getGroupByClause, getHavingClause, getWhereClause, hasGroupByClause, hasHavingClause, hasWhereClause, identificationVariables, initialize, isEquivalent, parseSelect, removeGroupByClause, removeHavingClause, removeWhereClause, toggleGroupByClause, toggleHavingClause, toggleWhereClause, toTextInternal
acceptUnknownVisitor, acceptUnknownVisitor, addProblems, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, firePropertyChanged, getChangeSupport, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toText
public SimpleSelectStatementStateObject(StateObject parent)
SimpleSelectStatementStateObject
.parent
- The parent of this state object, which cannot be null
java.lang.NullPointerException
- The given parent cannot be null
public void accept(StateObjectVisitor visitor)
StateObject
by the given visitor
.visitor
- The visitor
to visit this objectpublic CollectionMemberDeclarationStateObject addDerivedCollectionDeclaration()
FROM
clause.CollectionMemberDeclarationStateObject
representing the collection
declarationpublic CollectionMemberDeclarationStateObject addDerivedCollectionDeclaration(java.lang.String collectionValuedPath)
FROM
clause.collectionValuedPath
- The collection-valued path expressionCollectionMemberDeclarationStateObject
representing the collection
declarationpublic DerivedPathIdentificationVariableDeclarationStateObject addDerivedPathDeclaration()
FROM
clause.DerivedPathIdentificationVariableDeclarationStateObject
representing the collection
declarationpublic DerivedPathIdentificationVariableDeclarationStateObject addDerivedPathDeclaration(java.lang.String path, java.lang.String identificationVariable)
FROM
clause.path
- Either the derived singled-valued object field or the collection-valued path expressionidentificationVariable
- The identification variable defining the given pathDerivedPathIdentificationVariableDeclarationStateObject
representing the
path declarationprotected AbstractFromClauseStateObject buildFromClause()
FROM
clause.buildFromClause
in class AbstractSelectStatementStateObject
AbstractFromClauseStateObject
protected AbstractSelectClauseStateObject buildSelectClause()
SELECT
clause.buildSelectClause
in class AbstractSelectStatementStateObject
AbstractSelectClauseStateObject
public SimpleSelectStatement getExpression()
StateObject
representation of the JPQL query
was created by parsing an existing JPQL query.getExpression
in interface StateObject
getExpression
in class AbstractSelectStatementStateObject
StateObject
or null
when the JPQL query is manually created (i.e. not from a string)public SimpleFromClauseStateObject getFromClause()
FROM
clause.getFromClause
in class AbstractSelectStatementStateObject
FROM
clause, which is never
null
public ISimpleSelectExpressionStateObjectBuilder getSelectBuilder()
ISimpleSelectExpressionStateObjectBuilder
that can be used
to programmatically create a single select expression and once the expression is complete,
ISimpleSelectExpressionStateObjectBuilder.commit()
will push the StateObject
representation of that expression as this clause's select expression.public SimpleSelectClauseStateObject getSelectClause()
SELECT
clause.getSelectClause
in class AbstractSelectStatementStateObject
SELECT
clause,
which is never null
public void setExpression(SimpleSelectStatement expression)
parsed object
object, which should only
be done when this object is instantiated during the conversion of a parsed JPQL query into
StateObjects
.expression
- The parsed object
representing a subquery
SELECT
public void setSelectItem(StateObject stateObject)
StateObject
as the SELECT
clause's select item.stateObject
- The StateObject
representing the single select itempublic void setSelectItem(java.lang.String jpqlFragment)
jpqlFragment
- The portion of the query representing one or several select items