Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public abstract Class AbstractModifyStatementStateObject

extends AbstractStateObject
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.DeleteStatementStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.UpdateStatementStateObject
Annotations
@SuppressWarnings:nls
Imports
java.io.IOException, java.util.List, org.eclipse.persistence.jpa.jpql.tools.spi.IEntity

The abstract definition of a modify statement. TODO
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
DeleteStatementStateObject, UpdateStatementStateObject

Field Summary

Modifier and TypeField and Description
private AbstractModifyClauseStateObject
modifyClause

The state object representing the modify clause.

public static final String
WHERE_CLAUSE_PROPERTY

Notify the state object representing the WHERE clause has changed.

private WhereClauseStateObject
whereClause

The state object representing the WHERE clause.

Constructor Summary

AccessConstructor and Description
protected
AbstractModifyStatementStateObject(JPQLQueryStateObject
The parent of this state object, which cannot be null
parent
)

Creates a new AbstractModifyStatementStateObject.

Method Summary

Modifier and TypeMethod and Description
protected void
addChildren(List<StateObject>
The list used to store the children
children
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Adds the children of this StateObject to the given list.
public WhereClauseStateObject
addWhereClause()

Adds the WHERE clause.

protected abstract AbstractModifyClauseStateObject

Returns:

The modify clause part of this modify statement
buildModifyClause
()

Creates the actual AbstractModifyClauseStateObject that represents the modify clause.

public String

Returns:

The name of the abstract schema type for which the identification variable is ranging over
getAbstractSchemaName
()

Returns the abstract schema name.

public AbstractSchemaNameStateObject

Returns:

The AbstractSchemaNameStateObject, which is never null
getAbstractSchemaNameStateObject
()

Returns the AbstractSchemaNameStateObject holding onto the abstract schema name.

public DeclarationStateObject
getDeclaration()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getDeclaration.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getDeclaration.

Returns the declaration clause which defines the domain of the query by declaring identification variables.
public IEntity

Returns:

The actual IEntity or null if no entity exists
getEntity
()

Returns the actual IEntity that has the abstract schema name.

public String

Returns:

The identification variable name
getIdentificationVariable
()

Returns the identification variable name that is ranging over the abstract schema type.

public IdentificationVariableStateObject

Returns:

The IdentificationVariableStateObject, which is never null
getIdentificationVariableStateObject
()

Returns the IdentificationVariableStateObject holding onto the identification variable.

public AbstractModifyClauseStateObject

Returns:

The state object representing the modify clause part of the modify statement, which is never null
getModifyClause
()

Returns the state object representing the modify clause part of the modify statement.

public JPQLQueryStateObject
public RangeVariableDeclarationStateObject

Returns:

The StateObject that defines the range variable declaration, which is never null
getRangeVariableDeclaration
()

Returns the StateObject that defines the range variable declaration.

public WhereClauseStateObject

Returns:

Either the actual state object representing the WHERE clause or the null state object since null is never returned
getWhereClause
()

Returns the state object representing the WHERE clause.

public boolean

Returns:

Either the actual state object representing the WHERE clause or null if it's not present
hasWhereClause
()

Returns the state object representing the WHERE clause.

protected void
public boolean
isEquivalent(StateObject
The StateObject to compare its content to this one
stateObject
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.isEquivalent.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
public void
removeWhereClause()

Removes the WHERE clause.

public void
setConditionalStateObject(StateObject
The new conditional expression
conditionalStateObject
)

Sets the given StateObject to be the conditional expression of the WHERE clause.

public void
setDeclaration(IEntity
The IEntity that this clause will range over
entity
)

Sets the abstract schema name to the given value.

public void
setDeclaration(IEntity
The IEntity that this clause will range over
entity
,
String
The new identification variable
identificationVariable
)

Sets the abstract schema name to the given value and the identification variable that will range over it.

public void
setDeclaration(String
The name of the abstract schema, which is the name of the entity
abstractSchemaName
)

Sets the abstract schema name to the given value and removes the identification variable.

public void
setDeclaration(String
The name of the abstract schema, which is the name of the entity
abstractSchemaName
,
String
The new identification variable
identificationVariable
)

Sets the abstract schema name to the given value and the identification variable that will range over it.

public void
setEntity(IEntity
The IEntity that this clause will range over
entity
)

Sets the actual IEntity and updates the abstract schema name.

public void
setEntityName(String
The name of the entity
entityName
)

Sets the name of the abstract schema, which is the name of the entity.

public void
setIdentificationVariable(String
The new identification variable
identificationVariable
)

Sets the new identification variable that will range over the abstract schema name.

private void
public void
toggleWhereClause()

Either adds or removes the state object representing the WHERE clause.

protected void
toTextInternal(Appendable
The writer used to print out the string representation
writer
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject:
acceptUnknownVisitoracceptUnknownVisitoraddProblemsaddPropertyChangeListenerareEquivalentbuildProblembuildProblembuildStateObjectbuildStateObjectscheckParentchildrendecorateequalsfindIdentificationVariablefirePropertyChangedgetChangeSupportgetDecoratorgetExpressiongetGrammargetManagedTypeProvidergetQueryBuildergetRootgetTypegetTypegetTypeHelpergetTypeRepositoryhashCodeisDecoratedparentparentparentremovePropertyChangeListenersetExpressionsetParenttoStringtoStringtoStringInternaltoStringItemstoText

Field Detail

modifyClauseback to summary
private AbstractModifyClauseStateObject modifyClause

The state object representing the modify clause.

WHERE_CLAUSE_PROPERTYback to summary
public static final String WHERE_CLAUSE_PROPERTY

Notify the state object representing the WHERE clause has changed.

whereClauseback to summary
private WhereClauseStateObject whereClause

The state object representing the WHERE clause.

Constructor Detail

AbstractModifyStatementStateObjectback to summary
protected AbstractModifyStatementStateObject(JPQLQueryStateObject parent)

Creates a new AbstractModifyStatementStateObject.

Parameters
parent:JPQLQueryStateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

addChildrenback to summary
protected void addChildren(List<StateObject> children)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Adds the children of this StateObject to the given list.

Parameters
children:List<StateObject>

The list used to store the children

Annotations
@Override
addWhereClauseback to summary
public WhereClauseStateObject addWhereClause()

Adds the WHERE clause. The clause is not added if it's already present.

Returns:WhereClauseStateObject

The GroupByClauseStateObject

buildModifyClauseback to summary
protected abstract AbstractModifyClauseStateObject buildModifyClause()

Creates the actual AbstractModifyClauseStateObject that represents the modify clause.

Returns:AbstractModifyClauseStateObject

The modify clause part of this modify statement

getAbstractSchemaNameback to summary
public String getAbstractSchemaName()

Returns the abstract schema name.

Returns:String

The name of the abstract schema type for which the identification variable is ranging over

getAbstractSchemaNameStateObjectback to summary
public AbstractSchemaNameStateObject getAbstractSchemaNameStateObject()

Returns the AbstractSchemaNameStateObject holding onto the abstract schema name.

Returns:AbstractSchemaNameStateObject

The AbstractSchemaNameStateObject, which is never null

getDeclarationback to summary
public DeclarationStateObject getDeclaration()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getDeclaration.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getDeclaration.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getDeclaration.

Returns the declaration clause which defines the domain of the query by declaring identification variables.

Returns:DeclarationStateObject

The declaration clause of which this StateObject is 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

Annotations
@Override
getEntityback to summary
public IEntity getEntity()

Returns the actual IEntity that has the abstract schema name.

Returns:IEntity

The actual IEntity or null if no entity exists

getIdentificationVariableback to summary
public String getIdentificationVariable()

Returns the identification variable name that is ranging over the abstract schema type.

Returns:String

The identification variable name

getIdentificationVariableStateObjectback to summary
public IdentificationVariableStateObject getIdentificationVariableStateObject()

Returns the IdentificationVariableStateObject holding onto the identification variable.

Returns:IdentificationVariableStateObject

The IdentificationVariableStateObject, which is never null

getModifyClauseback to summary
public AbstractModifyClauseStateObject getModifyClause()

Returns the state object representing the modify clause part of the modify statement.

Returns:AbstractModifyClauseStateObject

The state object representing the modify clause part of the modify statement, which is never null

getParentback to summary
public JPQLQueryStateObject getParent()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getParent.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getParent.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getParent.

Returns the parent of this StateObject.

Returns:JPQLQueryStateObject

Returns the parent of this StateObject, which is null only when this is the root of the hierarchy

Annotations
@Override
getRangeVariableDeclarationback to summary
public RangeVariableDeclarationStateObject getRangeVariableDeclaration()

Returns the StateObject that defines the range variable declaration.

Returns:RangeVariableDeclarationStateObject

The StateObject that defines the range variable declaration, which is never null

getWhereClauseback to summary
public WhereClauseStateObject getWhereClause()

Returns the state object representing the WHERE clause.

Returns:WhereClauseStateObject

Either the actual state object representing the WHERE clause or the null state object since null is never returned

hasWhereClauseback to summary
public boolean hasWhereClause()

Returns the state object representing the WHERE clause.

Returns:boolean

Either the actual state object representing the WHERE clause or null if it's not present

initializeback to summary
protected void initialize()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.initialize.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.initialize.

Initializes this state object.

Annotations
@Override
isEquivalentback to summary
public boolean isEquivalent(StateObject stateObject)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.isEquivalent.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.

Parameters
stateObject:StateObject

The StateObject to compare its content to this one

Returns:boolean

true if both object are equivalent; false otherwise

Annotations
@Override
removeWhereClauseback to summary
public void removeWhereClause()

Removes the WHERE clause.

setConditionalStateObjectback to summary
public void setConditionalStateObject(StateObject conditionalStateObject)

Sets the given StateObject to be the conditional expression of the WHERE clause.

Parameters
conditionalStateObject:StateObject

The new conditional expression

setDeclarationback to summary
public void setDeclaration(IEntity entity)

Sets the abstract schema name to the given value.

Parameters
entity:IEntity

The IEntity that this clause will range over

setDeclarationback to summary
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:IEntity

The IEntity that this clause will range over

identificationVariable:String

The new identification variable

setDeclarationback to summary
public void setDeclaration(String abstractSchemaName)

Sets the abstract schema name to the given value and removes the identification variable.

Parameters
abstractSchemaName:String

The name of the abstract schema, which is the name of the entity

setDeclarationback to summary
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:String

The name of the abstract schema, which is the name of the entity

identificationVariable:String

The new identification variable

setEntityback to summary
public void setEntity(IEntity entity)

Sets the actual IEntity and updates the abstract schema name.

Parameters
entity:IEntity

The IEntity that this clause will range over

setEntityNameback to summary
public void setEntityName(String entityName)

Sets the name of the abstract schema, which is the name of the entity.

Parameters
entityName:String

The name of the entity

setIdentificationVariableback to summary
public void setIdentificationVariable(String identificationVariable)

Sets the new identification variable that will range over the abstract schema name.

Parameters
identificationVariable:String

The new identification variable

setWhereClauseback to summary
private void setWhereClause(WhereClauseStateObject whereClause)
toggleWhereClauseback to summary
public void toggleWhereClause()

Either adds or removes the state object representing the WHERE clause.

toTextInternalback to summary
protected void toTextInternal(Appendable writer) throws IOException

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.

Parameters
writer:Appendable

The writer used to print out the string representation

Annotations
@Override
Exceptions
IOException:
This should never happens, it is only required because Appendable is used instead of any concrete class