public class UpdateItemStateObject extends AbstractStateObject
new_value
specified for an update operation must be compatible in type with the
field to which it is assigned.
update_item ::= [identification_variable.]{state_field | single_valued_association_field} = new_value
UpdateItem
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEW_VALUE_PROPERTY
Notifies the new value property has changed.
|
Constructor and Description |
---|
UpdateItemStateObject(UpdateClauseStateObject parent)
Creates a new
UpdateItemStateObject . |
UpdateItemStateObject(UpdateClauseStateObject parent,
java.lang.String path,
StateObject newValue)
Creates a new
UpdateItemStateObject . |
UpdateItemStateObject(UpdateClauseStateObject parent,
java.lang.String path,
java.lang.String newValue)
Creates a new
UpdateItemStateObject . |
Modifier and Type | Method and Description |
---|---|
void |
accept(StateObjectVisitor visitor)
Visits this
StateObject by the given visitor . |
void |
appendToPath(java.lang.String text)
Appends the given sequence of characters to the path expression.
|
INewValueStateObjectBuilder |
getBuilder()
Creates and returns a new
INewValueStateObjectBuilder that can be used to
programmatically create a new value expression and once the expression is complete,
INewValueStateObjectBuilder.commit() will push the StateObject
representation of that expression as this new value object. |
UpdateItem |
getExpression()
Returns the actual parsed object if this
StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
StateObject |
getNewValue()
Returns the
StateObject representing the new value. |
UpdateClauseStateObject |
getParent()
Returns the parent of this
StateObject . |
java.lang.String |
getPath()
Returns the string representation of the path expression.
|
StateFieldPathExpressionStateObject |
getStateFieldPath()
Returns
|
boolean |
hasNewValue()
Determines whether the
StateObject representing the new value is present. |
boolean |
isEquivalent(StateObject stateObject)
Determines whether the given
StateObject is equivalent to this one, i.e. |
ListIterable<java.lang.String> |
items()
Returns the segments in the state field path in order.
|
int |
itemsSize()
Returns the number of segments in the path expression.
|
void |
parseNewValue(java.lang.String newValue)
Parses the given JPQL fragment, which represents the new value.
|
void |
setExpression(UpdateItem 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 |
setNewValue(StateObject newValue)
Sets the new value to be the given
StateObject . |
void |
setPath(java.lang.String path)
Changes the path expression with the list of segments, the identification variable will also
be updated with the first segment.
|
void |
setPaths(java.util.ListIterator<java.lang.String> paths)
Changes the path expression with the list of segments, the identification variable will also
be updated with the first segment.
|
void |
setPaths(java.lang.String[] paths)
Changes the path expression with the list of segments, the identification variable will also
be updated with the first segment.
|
void |
setVirtualIdentificationVariable(java.lang.String identificationVariable)
The state field path expression is not qualified by the identification variable.
|
addPropertyChangeListener, children, decorate, equals, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, removePropertyChangeListener, setExpression, setParent, toString, toString, toText
public static final java.lang.String NEW_VALUE_PROPERTY
public UpdateItemStateObject(UpdateClauseStateObject parent)
UpdateItemStateObject
.parent
- The parent of this state object, which cannot be null
java.lang.NullPointerException
- The given parent cannot be null
public UpdateItemStateObject(UpdateClauseStateObject parent, java.lang.String path, StateObject newValue)
UpdateItemStateObject
.parent
- The parent of this state object, which cannot be null
path
- The state field path to receive the new valuenewValue
- The actual expression representing the new valuejava.lang.NullPointerException
- The given parent cannot be null
public UpdateItemStateObject(UpdateClauseStateObject parent, java.lang.String path, java.lang.String newValue)
UpdateItemStateObject
.parent
- The parent of this state object, which cannot be null
path
- The state field path to receive the new valuenewValue
- The JPQL fragment representing the new valuejava.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 void appendToPath(java.lang.String text)
text
- The sequence of characters to append to the path expressionpublic INewValueStateObjectBuilder getBuilder()
INewValueStateObjectBuilder
that can be used to
programmatically create a new value expression and once the expression is complete,
INewValueStateObjectBuilder.commit()
will push the StateObject
representation of that expression as this new value object.public UpdateItem getExpression()
StateObject
representation of the JPQL query
was created by parsing an existing JPQL query.getExpression
in interface StateObject
getExpression
in class AbstractStateObject
StateObject
or null
when the JPQL query is manually created (i.e. not from a string)public StateObject getNewValue()
StateObject
representing the new value.null
if it's not yet definedpublic UpdateClauseStateObject getParent()
StateObject
.getParent
in interface StateObject
getParent
in class AbstractStateObject
StateObject
, which is null
only when
this is the root of the hierarchypublic java.lang.String getPath()
null
public StateFieldPathExpressionStateObject getStateFieldPath()
public boolean hasNewValue()
StateObject
representing the new value is present.true
the new value exists; otherwise false
public boolean isEquivalent(StateObject stateObject)
StateObject
is equivalent to this one, i.e. the
information of both StateObject
is the same.isEquivalent
in interface StateObject
isEquivalent
in class AbstractStateObject
stateObject
- The StateObject
to compare its content to this onetrue
if both object are equivalent; false
otherwisepublic ListIterable<java.lang.String> items()
ListIterable
over the paths of the state field pathpublic int itemsSize()
public void parseNewValue(java.lang.String newValue)
newValue
- The string representation of the new value to parse and to convert into a
StateObject
public void setExpression(UpdateItem 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 an update itempublic void setNewValue(StateObject newValue)
StateObject
.newValue
- The StateObject
representing the new valuepublic void setPath(java.lang.String path)
path
- The new path expressionpublic void setPaths(java.util.ListIterator<java.lang.String> paths)
paths
- The new path expressionpublic void setPaths(java.lang.String[] paths)
paths
- The new path expressionpublic void setVirtualIdentificationVariable(java.lang.String identificationVariable)
identificationVariable
- The virtual variable that was generated based on the entity nameEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference