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

public abstract Class AbstractModifyClauseStateObject

extends AbstractStateObject
implements DeclarationStateObject
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.DeleteClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.UpdateClauseStateObject
Imports
java.io.IOException, java.util.List, org.eclipse.persistence.jpa.jpql.tools.spi.IEntity, .IManagedType, org.eclipse.persistence.jpa.jpql.tools.utility.iterable.SingleElementListIterable, org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable

Author
Pascal Filion
Since
2.4
Version
2.5

Field Summary

Modifier and TypeField and Description
private RangeVariableDeclarationStateObject
rangeVariableDeclaration

The state object defining the range variable declaration.

Constructor Summary

AccessConstructor and Description
protected
AbstractModifyClauseStateObject(AbstractModifyStatementStateObject
The parent of this state object
parent
)

Creates a new UpdateClauseStateObject.

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 ListIterable<VariableDeclarationStateObject>
declarations()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.declarations.

Returns the list of declarations declared in the declaration clause of the current query.
public IManagedType
findManagedType(StateObject
The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE
stateObject
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.findManagedType.

Returns the IManagedType for the given identification variable.
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 abstract String

Returns:

The JPQL identifier
getIdentifier
()

Returns the JPQL identifier of this clause.

public IManagedType
getManagedType(StateObject
The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE
stateObject
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.getManagedType.

Returns the IManagedType for the given identification variable.
public AbstractModifyStatementStateObject
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 boolean

Returns:

true if an identification variable is defined; false otherwise
hasIdentificationVariable
()

Determines whether an identification variable was defined.

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
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.

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

rangeVariableDeclarationback to summary
private RangeVariableDeclarationStateObject rangeVariableDeclaration

The state object defining the range variable declaration.

Constructor Detail

AbstractModifyClauseStateObjectback to summary
protected AbstractModifyClauseStateObject(AbstractModifyStatementStateObject parent)

Creates a new UpdateClauseStateObject.

Parameters
parent:AbstractModifyStatementStateObject

The parent of this state object

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
declarationsback to summary
public ListIterable<VariableDeclarationStateObject> declarations()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.declarations.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.declarations.

Returns the list of declarations declared in the declaration clause of the current query.

Returns:ListIterable<VariableDeclarationStateObject>

The list of VariableDeclarationStateObject that define the domain of the query

Annotations
@Override
findManagedTypeback to summary
public IManagedType findManagedType(StateObject stateObject)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.findManagedType.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.findManagedType.

Returns the IManagedType for the given identification variable. If the declaration is for a subquery and there is no managed type associated with the identification then the search will traverse up the query hierarchy.

SELECT e FROM Department d JOIN KEY(d.employees).addresses a
In the above query, the managed type associated with the identification variable:
  • d is "Department"
  • a is "Address"
Parameters
stateObject:StateObject

The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE

Returns:IManagedType

The IManagedType representing the domain object declared by the given identification variable

Annotations
@Override
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

getIdentifierback to summary
public abstract String getIdentifier()

Returns the JPQL identifier of this clause.

Returns:String

The JPQL identifier

getManagedTypeback to summary
public IManagedType getManagedType(StateObject stateObject)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.getManagedType.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.getManagedType.

Returns the IManagedType for the given identification variable. The search does not traverse up the query hierarchy if this declaration is for a subquery.

SELECT e FROM Department d JOIN KEY(d.employees).addresses a
In the above query, the managed type associated with the identification variable:
  • d is "Department"
  • a is "Address"
Parameters
stateObject:StateObject

The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE

Returns:IManagedType

The IManagedType representing the domain object declared by the given identification variable

Annotations
@Override
getParentback to summary
public AbstractModifyStatementStateObject 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:AbstractModifyStatementStateObject

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

hasIdentificationVariableback to summary
public boolean hasIdentificationVariable()

Determines whether an identification variable was defined.

Returns:boolean

true if an identification variable is defined; false otherwise

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
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

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