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

public Class UpdateStatementStateObject

extends AbstractModifyStatementStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.UpdateStatement

The UPDATE clause of a query consists of a conditional expression used to select objects or values that satisfy the expression. The UPDATE clause restricts the result of a select statement or the scope of an update operation.

BNF: update_statement ::= update_clause [where_clause]

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
UpdateStatement

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject:
WHERE_CLAUSE_PROPERTY

Constructor Summary

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

Creates a new UpdateStatementStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public UpdateItemStateObject

Returns:

The newly added UpdateItemStateObject
addItem
(String
The path of the value to update
path
)

Adds a new item to the UPDATE clause.

public UpdateItemStateObject

Returns:

The newly added UpdateItemStateObject
addItem
(String
The path of the value to update
path
,
StateObject
The StateObject representation of the new value
newValue
)

Adds a new item to the UPDATE clause.

public UpdateItemStateObject

Returns:

The newly added UpdateItemStateObject
addItem
(String
The path of the value to update
path
,
String
The string representation of the new value to parse and to convert into a StateObject representation
newValue
)

Adds a new item to the UPDATE clause.

protected AbstractModifyClauseStateObject
public UpdateStatement
getExpression()

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

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

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
public UpdateClauseStateObject

Returns:

The state object representing the UPDATE clause, which is never null
getModifyClause
()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject.getModifyClause.

Returns the state object representing the UPDATE clause.
public void
setExpression(UpdateStatement
The parsed object representing an UpdateStatement statement
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.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject:
addChildrenaddWhereClausegetAbstractSchemaNamegetAbstractSchemaNameStateObjectgetDeclarationgetEntitygetIdentificationVariablegetIdentificationVariableStateObjectgetParentgetRangeVariableDeclarationgetWhereClausehasWhereClauseinitializeisEquivalentremoveWhereClausesetConditionalStateObjectsetDeclarationsetDeclarationsetDeclarationsetDeclarationsetEntitysetEntityNamesetIdentificationVariabletoggleWhereClausetoTextInternal

Constructor Detail

UpdateStatementStateObjectback to summary
public UpdateStatementStateObject(JPQLQueryStateObject parent)

Creates a new UpdateStatementStateObject.

Parameters
parent:JPQLQueryStateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

acceptback to summary
public void accept(StateObjectVisitor visitor)

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

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

Visits this StateObject by the given visitor.

Parameters
visitor:StateObjectVisitor

The visitor to visit this object

Annotations
@Override
addItemback to summary
public UpdateItemStateObject addItem(String path)

Adds a new item to the UPDATE clause.

Parameters
path:String

The path of the value to update

Returns:UpdateItemStateObject

The newly added UpdateItemStateObject

addItemback to summary
public UpdateItemStateObject addItem(String path, StateObject newValue)

Adds a new item to the UPDATE clause.

Parameters
path:String

The path of the value to update

newValue:StateObject

The StateObject representation of the new value

Returns:UpdateItemStateObject

The newly added UpdateItemStateObject

addItemback to summary
public UpdateItemStateObject addItem(String path, String newValue)

Adds a new item to the UPDATE clause.

Parameters
path:String

The path of the value to update

newValue:String

The string representation of the new value to parse and to convert into a StateObject representation

Returns:UpdateItemStateObject

The newly added UpdateItemStateObject

buildModifyClauseback to summary
protected AbstractModifyClauseStateObject buildModifyClause()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject.buildModifyClause.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject.buildModifyClause.

Creates the actual AbstractModifyClauseStateObject that represents the modify clause.

Returns:AbstractModifyClauseStateObject

The modify clause part of this modify statement

Annotations
@Override
getExpressionback to summary
public UpdateStatement getExpression()

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

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

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

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Returns:UpdateStatement

The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)

Annotations
@Override
getModifyClauseback to summary
public UpdateClauseStateObject getModifyClause()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject.getModifyClause.

Returns the state object representing the UPDATE clause.

Returns:UpdateClauseStateObject

The state object representing the UPDATE clause, which is never null

Annotations
@Override
setExpressionback to summary
public void setExpression(UpdateStatement 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.

Parameters
expression:UpdateStatement

The parsed object representing an UpdateStatement statement