Class AbstractModifyStatementStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject
-
- All Implemented Interfaces:
StateObject
- Direct Known Subclasses:
DeleteStatementStateObject,UpdateStatementStateObject
public abstract class AbstractModifyStatementStateObject extends AbstractStateObject
The abstract definition of a modify statement. TODO- Since:
- 2.4
- Version:
- 2.4
- Author:
- Pascal Filion
- See Also:
DeleteStatementStateObject,UpdateStatementStateObject
-
-
Field Summary
Fields Modifier and Type Field Description static StringWHERE_CLAUSE_PROPERTYNotify the state object representing theWHEREclause has changed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WhereClauseStateObjectaddWhereClause()Adds theWHEREclause.StringgetAbstractSchemaName()Returns the abstract schema name.AbstractSchemaNameStateObjectgetAbstractSchemaNameStateObject()Returns theAbstractSchemaNameStateObjectholding onto the abstract schema name.DeclarationStateObjectgetDeclaration()Returns the declaration clause which defines the domain of the query by declaring identification variables.IEntitygetEntity()Returns the actualIEntitythat has the abstract schema name.StringgetIdentificationVariable()Returns the identification variable name that is ranging over the abstract schema type.IdentificationVariableStateObjectgetIdentificationVariableStateObject()Returns theIdentificationVariableStateObjectholding onto the identification variable.AbstractModifyClauseStateObjectgetModifyClause()Returns the state object representing the modify clause part of the modify statement.JPQLQueryStateObjectgetParent()Returns the parent of thisStateObject.RangeVariableDeclarationStateObjectgetRangeVariableDeclaration()Returns theStateObjectthat defines the range variable declaration.WhereClauseStateObjectgetWhereClause()Returns the state object representing theWHEREclause.booleanhasWhereClause()Returns the state object representing theWHEREclause.booleanisEquivalent(StateObject stateObject)Determines whether the givenStateObjectis equivalent to this one, i.e.voidremoveWhereClause()Removes theWHEREclause.voidsetConditionalStateObject(StateObject conditionalStateObject)Sets the givenStateObjectto be the conditional expression of theWHEREclause.voidsetDeclaration(String abstractSchemaName)Sets the abstract schema name to the given value and removes the identification variable.voidsetDeclaration(String abstractSchemaName, String identificationVariable)Sets the abstract schema name to the given value and the identification variable that will range over it.voidsetDeclaration(IEntity entity)Sets the abstract schema name to the given value.voidsetDeclaration(IEntity entity, String identificationVariable)Sets the abstract schema name to the given value and the identification variable that will range over it.voidsetEntity(IEntity entity)Sets the actualIEntityand updates the abstract schema name.voidsetEntityName(String entityName)Sets the name of the abstract schema, which is the name of the entity.voidsetIdentificationVariable(String identificationVariable)Sets the new identification variable that will range over the abstract schema name.voidtoggleWhereClause()Either adds or removes the state object representing theWHEREclause.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
addPropertyChangeListener, children, decorate, equals, findIdentificationVariable, getDecorator, getExpression, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, removePropertyChangeListener, setExpression, setParent, toString, toString, toText
-
Methods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
accept
-
-
-
-
Field Detail
-
WHERE_CLAUSE_PROPERTY
public static final String WHERE_CLAUSE_PROPERTY
Notify the state object representing theWHEREclause has changed.- See Also:
- Constant Field Values
-
-
Method Detail
-
addWhereClause
public WhereClauseStateObject addWhereClause()
Adds theWHEREclause. The clause is not added if it's already present.- Returns:
- The
GroupByClauseStateObject
-
getAbstractSchemaName
public String getAbstractSchemaName()
Returns the abstract schema name.- Returns:
- The name of the abstract schema type for which the identification variable is ranging over
-
getAbstractSchemaNameStateObject
public AbstractSchemaNameStateObject getAbstractSchemaNameStateObject()
Returns theAbstractSchemaNameStateObjectholding onto the abstract schema name.- Returns:
- The
AbstractSchemaNameStateObject, which is nevernull
-
getDeclaration
public DeclarationStateObject getDeclaration()
Returns the declaration clause which defines the domain of the query by declaring identification variables.- Specified by:
getDeclarationin interfaceStateObject- Overrides:
getDeclarationin classAbstractStateObject- Returns:
- The declaration clause of which this
StateObjectis a child; i.e. either the top-level declaration if this is part of the top query or the sub-level declaration if this is part of a subquery
-
getEntity
public IEntity getEntity()
Returns the actualIEntitythat has the abstract schema name.- Returns:
- The actual
IEntityornullif no entity exists
-
getIdentificationVariable
public String getIdentificationVariable()
Returns the identification variable name that is ranging over the abstract schema type.- Returns:
- The identification variable name
-
getIdentificationVariableStateObject
public IdentificationVariableStateObject getIdentificationVariableStateObject()
Returns theIdentificationVariableStateObjectholding onto the identification variable.- Returns:
- The
IdentificationVariableStateObject, which is nevernull
-
getModifyClause
public AbstractModifyClauseStateObject getModifyClause()
Returns the state object representing the modify clause part of the modify statement.- Returns:
- The state object representing the modify clause part of the modify statement, which is
never
null
-
getParent
public JPQLQueryStateObject getParent()
Returns the parent of thisStateObject.- Specified by:
getParentin interfaceStateObject- Overrides:
getParentin classAbstractStateObject- Returns:
- Returns the parent of this
StateObject, which isnullonly when this is the root of the hierarchy
-
getRangeVariableDeclaration
public RangeVariableDeclarationStateObject getRangeVariableDeclaration()
Returns theStateObjectthat defines the range variable declaration.- Returns:
- The
StateObjectthat defines the range variable declaration, which is nevernull
-
getWhereClause
public WhereClauseStateObject getWhereClause()
Returns the state object representing theWHEREclause.- Returns:
- Either the actual state object representing the
WHEREclause or thenullstate object sincenullis never returned
-
hasWhereClause
public boolean hasWhereClause()
Returns the state object representing theWHEREclause.- Returns:
- Either the actual state object representing the
WHEREclause ornullif it's not present
-
isEquivalent
public boolean isEquivalent(StateObject stateObject)
Determines whether the givenStateObjectis equivalent to this one, i.e. the information of bothStateObjectis the same.- Specified by:
isEquivalentin interfaceStateObject- Overrides:
isEquivalentin classAbstractStateObject- Parameters:
stateObject- TheStateObjectto compare its content to this one- Returns:
trueif both object are equivalent;falseotherwise
-
removeWhereClause
public void removeWhereClause()
Removes theWHEREclause.
-
setConditionalStateObject
public void setConditionalStateObject(StateObject conditionalStateObject)
Sets the givenStateObjectto be the conditional expression of theWHEREclause.- Parameters:
conditionalStateObject- The new conditional expression
-
setDeclaration
public void setDeclaration(IEntity entity)
Sets the abstract schema name to the given value.- Parameters:
entity- TheIEntitythat this clause will range over
-
setDeclaration
public void setDeclaration(IEntity entity, String identificationVariable)
Sets the abstract schema name to the given value and the identification variable that will range over it.- Parameters:
entity- TheIEntitythat this clause will range overidentificationVariable- The new identification variable
-
setDeclaration
public void setDeclaration(String abstractSchemaName)
Sets the abstract schema name to the given value and removes the identification variable.- Parameters:
abstractSchemaName- The name of the abstract schema, which is the name of the entity
-
setDeclaration
public void setDeclaration(String abstractSchemaName, String identificationVariable)
Sets the abstract schema name to the given value and the identification variable that will range over it.- Parameters:
abstractSchemaName- The name of the abstract schema, which is the name of the entityidentificationVariable- The new identification variable
-
setEntity
public void setEntity(IEntity entity)
Sets the actualIEntityand updates the abstract schema name.- Parameters:
entity- TheIEntitythat this clause will range over
-
setEntityName
public void setEntityName(String entityName)
Sets the name of the abstract schema, which is the name of the entity.- Parameters:
entityName- The name of the entity
-
setIdentificationVariable
public void setIdentificationVariable(String identificationVariable)
Sets the new identification variable that will range over the abstract schema name.- Parameters:
identificationVariable- The new identification variable
-
toggleWhereClause
public void toggleWhereClause()
Either adds or removes the state object representing theWHEREclause.
-
-