Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.querydef

public Class CriteriaUpdateImpl<T>

extends CommonAbstractCriteriaImpl<T>
implements CriteriaUpdate<T>
Class Inheritance
All Implemented Interfaces
jakarta.persistence.criteria.CriteriaUpdate, jakarta.persistence.criteria.CommonAbstractCriteria
Imports
jakarta.persistence.criteria.CriteriaUpdate, .Expression, .Path, .Predicate, .Root, jakarta.persistence.metamodel.EntityType, .Metamodel, .SingularAttribute, org.eclipse.persistence.queries.DatabaseQuery, .UpdateAllQuery

Purpose: Contains the implementation of the CriteriaUpdate interface of the JPA criteria API.

Description: This is the container class for the components that define an Update Query.

Author
Chris Delahunt
Since
EclipseLink 2.5
See Also
CriteriaUpdate

Field Summary

Modifier and TypeField and Description
protected UpdateAllQuery
protected Root<T>
private static final long
Inherited from org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl:
metamodelparametersqueryBuilderqueryTypewhere

Constructor Summary

AccessConstructor and Description
public
CriteriaUpdateImpl(Metamodel metamodel, CriteriaBuilderImpl queryBuilder, Class<T> resultType)

Method Summary

Modifier and TypeMethod and Description
public Root<T>
from(Class<T>
the entity class
entityClass
)

Implements jakarta.persistence.criteria.CriteriaUpdate.from.

Create and add a query root corresponding to the entity that is the target of the update.
public Root<T>
from(EntityType<T>
metamodel entity representing the entity of type X
entity
)

Implements jakarta.persistence.criteria.CriteriaUpdate.from.

Create and add a query root corresponding to the entity that is the target of the update.
protected Expression
protected DatabaseQuery
public Root<T>
protected void
integrateRoot(RootImpl<X> root)

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.integrateRoot.

Used to use a root from a different query.
public <Y, X extends Y> CriteriaUpdate<T>
set(SingularAttribute<? super T, Y>
attribute to be updated
attribute
,
X
new value
value
)

Implements jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.
public <Y> CriteriaUpdate<T>
set(SingularAttribute<? super T, Y>
attribute to be updated
attribute
,
Expression<? extends Y>
new value
value
)

Implements jakarta.persistence.criteria.CriteriaUpdate.set, jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.
public <Y, X extends Y> CriteriaUpdate<T>
set(Path<Y>
attribute to be updated
attribute
,
X
new value
value
)

Implements jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.
public <Y> CriteriaUpdate<T>
set(Path<Y>
attribute to be updated
attribute
,
Expression<? extends Y>
new value
value
)

Implements jakarta.persistence.criteria.CriteriaUpdate.set, jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.
public CriteriaUpdate<T>
set(String
name of the attribute to be updated
attributeName
,
Object
new value
value
)

Implements jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.
public CriteriaUpdate<T>
where(Expression<Boolean>
a simple or compound boolean expression
restriction
)

Overrides org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.where.

Implements jakarta.persistence.criteria.CriteriaUpdate.where.

Modify the update query to restrict the target of the update according to the specified boolean expression.
public CriteriaUpdate<T>
where(Predicate...
zero or more restriction predicates
restrictions
)

Overrides org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.where.

Implements jakarta.persistence.criteria.CriteriaUpdate.where.

Modify the update query to restrict the target of the update according to the conjunction of the specified restriction predicates.
Inherited from org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl:
addParameterfindRootAndParametersfindRootAndParametersgetParametersgetRestrictiongetResultTypeinternalFrominternalFromsubquerytranslate

Field Detail

queryback to summary
protected UpdateAllQuery query
rootback to summary
protected Root<T> root
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.serialVersionUID.

Constructor Detail

CriteriaUpdateImplback to summary
public CriteriaUpdateImpl(Metamodel metamodel, CriteriaBuilderImpl queryBuilder, Class<T> resultType)

Method Detail

fromback to summary
public Root<T> from(Class<T> entityClass)

Implements jakarta.persistence.criteria.CriteriaUpdate.from.

Doc from jakarta.persistence.criteria.CriteriaUpdate.from.

Create and add a query root corresponding to the entity that is the target of the update. A CriteriaUpdate object has a single root, the entity that is being updated.

Parameters
entityClass:Class<T>

the entity class

Returns:Root<T>

query root corresponding to the given entity

Annotations
@Override
fromback to summary
public Root<T> from(EntityType<T> entity)

Implements jakarta.persistence.criteria.CriteriaUpdate.from.

Doc from jakarta.persistence.criteria.CriteriaUpdate.from.

Create and add a query root corresponding to the entity that is the target of the update. A CriteriaUpdate object has a single root, the entity that is being updated.

Parameters
entity:EntityType<T>

metamodel entity representing the entity of type X

Returns:Root<T>

query root corresponding to the given entity

Annotations
@Override
getBaseExpressionback to summary
protected Expression getBaseExpression()

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.getBaseExpression.

Annotations
@Override
getDatabaseQueryback to summary
protected DatabaseQuery getDatabaseQuery()

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.getDatabaseQuery.

Annotations
@Override
getRootback to summary
public Root<T> getRoot()

Implements jakarta.persistence.criteria.CriteriaUpdate.getRoot.

Doc from jakarta.persistence.criteria.CriteriaUpdate.getRoot.

Return the query root.

Returns:Root<T>

the query root

Annotations
@Override
integrateRootback to summary
protected void integrateRoot(RootImpl<X> root)

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.integrateRoot.

Doc from org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.integrateRoot.

Used to use a root from a different query.

Annotations
@Override
setback to summary
public <Y, X extends Y> CriteriaUpdate<T> set(SingularAttribute<? super T, Y> attribute, X value)

Implements jakarta.persistence.criteria.CriteriaUpdate.set.

Doc from jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.

Parameters
attribute:SingularAttribute<? super T, Y>

attribute to be updated

value:X

new value

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override
setback to summary
public <Y> CriteriaUpdate<T> set(SingularAttribute<? super T, Y> attribute, Expression<? extends Y> value)

Implements jakarta.persistence.criteria.CriteriaUpdate.set, jakarta.persistence.criteria.CriteriaUpdate.set.

Doc from jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.

Parameters
attribute:SingularAttribute<? super T, Y>

attribute to be updated

value:Expression<? extends Y>

new value

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override
setback to summary
public <Y, X extends Y> CriteriaUpdate<T> set(Path<Y> attribute, X value)

Implements jakarta.persistence.criteria.CriteriaUpdate.set.

Doc from jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.

Parameters
attribute:Path<Y>

attribute to be updated

value:X

new value

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override
setback to summary
public <Y> CriteriaUpdate<T> set(Path<Y> attribute, Expression<? extends Y> value)

Implements jakarta.persistence.criteria.CriteriaUpdate.set, jakarta.persistence.criteria.CriteriaUpdate.set.

Doc from jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.

Parameters
attribute:Path<Y>

attribute to be updated

value:Expression<? extends Y>

new value

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override
setback to summary
public CriteriaUpdate<T> set(String attributeName, Object value)

Implements jakarta.persistence.criteria.CriteriaUpdate.set.

Doc from jakarta.persistence.criteria.CriteriaUpdate.set.

Update the value of the specified attribute.

Parameters
attributeName:String

name of the attribute to be updated

value:Object

new value

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override
whereback to summary
public CriteriaUpdate<T> where(Expression<Boolean> restriction)

Overrides org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.where.

Implements jakarta.persistence.criteria.CriteriaUpdate.where.

Doc from jakarta.persistence.criteria.CriteriaUpdate.where.

Modify the update query to restrict the target of the update according to the specified boolean expression. Replaces the previously added restriction(s), if any.

Parameters
restriction:Expression<Boolean>

a simple or compound boolean expression

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override
whereback to summary
public CriteriaUpdate<T> where(Predicate... restrictions)

Overrides org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.where.

Implements jakarta.persistence.criteria.CriteriaUpdate.where.

Doc from jakarta.persistence.criteria.CriteriaUpdate.where.

Modify the update query to restrict the target of the update according to the conjunction of the specified restriction predicates. Replaces the previously added restriction(s), if any. If no restrictions are specified, any previously added restrictions are simply removed.

Parameters
restrictions:Predicate[]

zero or more restriction predicates

Returns:CriteriaUpdate<T>

the modified update query

Annotations
@Override