T
- the type of the entity set targeted by this update statementpublic interface Update<T extends StructuredType<?>> extends CqnUpdate, FilterableStatement<T,Update<T>>
CdsDataStore
.
Note that some methods in this interface mutually exclude each other and
cannot be combined. For example, the methods byId
,
byParams
, matching
, and
where
all set the where condition of the
enclosing statement, overwriting any previously stored conditions.Modifier and Type | Method and Description |
---|---|
Update<T> |
byId(Object idValue)
Sets the where condition of the update statement, requiring that the value of
the single key element of the target entity set is equal to the given
idValue.
|
Update<T> |
byParams(Collection<String> elementRefs)
Sets the where condition of the update statement.
|
Update<T> |
byParams(String... elementRefs)
Sets the where condition of the update statement.
|
static Update<StructuredType<?>> |
copy(CqnUpdate update)
|
static Update<StructuredType<?>> |
cqn(String cqnUpdate)
Creates an update statement to update data for a specified entity set.
|
Update<T> |
data(Map<String,?> data)
Sets the values to be updated by the update statement.
|
Update<T> |
data(String elementName,
Object value)
Adds an element to be updated to the update statement.
|
static Update<StructuredType<?>> |
entity(CdsEntity entity)
Creates an update statement to update data for a specified entity set.
|
static Update<StructuredType<?>> |
entity(CdsEntity entity,
UnaryOperator<StructuredType<?>> path)
Creates an update statement to update entries of a specified entity set.
|
static <R extends StructuredType<R>,T extends StructuredType<T>> |
entity(Class<R> entity,
Function<R,T> path)
Creates an update statement to update data for a specified entity set.
|
static <T extends StructuredType<T>> |
entity(Class<T> entity)
Creates an update statement to update data for a specified entity set.
|
static Update<StructuredType<?>> |
entity(CqnStructuredTypeRef ref)
Creates an update statement to update entries of a specified entity set.
|
static Update<StructuredType<?>> |
entity(String qualifiedName)
Creates an update statement to update entries of a specified entity set.
|
static Update<StructuredType<?>> |
entity(String qualifiedName,
UnaryOperator<StructuredType<?>> path)
Creates an update statement to update entries of a specified entity set.
|
static <T extends StructuredType<?>> |
entity(T entity)
Creates an update statement to update entries from a specified entity set.
|
Update<T> |
entries(Iterable<? extends Map<String,?>> entries)
Sets the batch data to be updated by the update statement.
|
Update<T> |
entry(Map<String,?> entry)
Sets the entry to be updated by the update statement.
|
Update<T> |
matching(Map<String,?> values)
Sets the where condition of the update statement.
|
Update<T> |
where(CqnPredicate predicate)
Sets the where condition of this update statement to a given predicate.
|
Update<T> |
where(Function<T,CqnPredicate> predicate)
Sets the where condition of this update statement.
|
asUpdate, data, elements, entries, isUpdate
where
asDelete, asInsert, asSelect, asUpsert, hints, isDelete, isInsert, isSelect, isUpsert, ref
toJson
static Update<StructuredType<?>> entity(String qualifiedName)
qualifiedName
- the fully qualified name of the CDS entity setstatic Update<StructuredType<?>> entity(CqnStructuredTypeRef ref)
ref
- the ref to the entitystatic <T extends StructuredType<?>> Update<T> entity(T entity)
T
- the type of the entity setentity
- the structured type representing the entity setstatic Update<StructuredType<?>> entity(String qualifiedName, UnaryOperator<StructuredType<?>> path)
qualifiedName
- the fully qualified name of the CDS entity setpath
- a path expression navigating from the root entity to the
target entity of the update statementstatic <T extends StructuredType<T>> Update<T> entity(Class<T> entity)
T
- the type of the entity setentity
- the static model representation of the entity setstatic <R extends StructuredType<R>,T extends StructuredType<T>> Update<T> entity(Class<R> entity, Function<R,T> path)
R
- the type of the root entityT
- the type of the target entityentity
- the static model representation of the entity setpath
- a path expression navigating from the root entity to the target
entity of the update statementstatic Update<StructuredType<?>> entity(CdsEntity entity, UnaryOperator<StructuredType<?>> path)
entity
- the model representation of the entity set obtained by
reflectionpath
- a path expression navigating from the root entity to the target
entity of the update statementCdsModel.findEntity(String)
,
CdsModel.entities()
static Update<StructuredType<?>> entity(CdsEntity entity)
entity
- the model representation of the entity set obtained by
reflectionCdsModel.findEntity(String)
,
CdsModel.entities()
static Update<StructuredType<?>> copy(CqnUpdate update)
update
- the CqnUpdate
to be copiedstatic Update<StructuredType<?>> cqn(String cqnUpdate)
cqnUpdate
- the CQN representation of the update statementUpdate<T> entries(Iterable<? extends Map<String,?>> entries)
entries
- a collection of data to be updated given as a map from element
name to new valueUpdate<T> entry(Map<String,?> entry)
entry
- the data to be updated as a map from element name to new valueUpdate<T> data(Map<String,?> data)
data
- the data to be updated as a map from element name to new valueUpdate<T> data(String elementName, Object value)
elementName
- the element name of the target entityvalue
- the new value of the elementUpdate<T> where(CqnPredicate predicate)
where
in interface FilterableStatement<T extends StructuredType<?>,Update<T extends StructuredType<?>>>
predicate
- a CqnPredicate
Update<T> where(Function<T,CqnPredicate> predicate)
where
in interface FilterableStatement<T extends StructuredType<?>,Update<T extends StructuredType<?>>>
predicate
- a Function
providing the where conditionUpdate<T> matching(Map<String,?> values)
CqnParameter
. The map entries are transformed into
comparison predicates and joined via and.matching
in interface FilterableStatement<T extends StructuredType<?>,Update<T extends StructuredType<?>>>
values
- the element name to value map defining the where conditionUpdate<T> byParams(String... elementRefs)
CqnParameter
that has the name of the ref. The predicates are
joined via and.byParams
in interface FilterableStatement<T extends StructuredType<?>,Update<T extends StructuredType<?>>>
elementRefs
- the element references defining the where conditionUpdate<T> byParams(Collection<String> elementRefs)
CqnParameter
that has the name of the ref. The predicates are joined
via and.byParams
in interface FilterableStatement<T extends StructuredType<?>,Update<T extends StructuredType<?>>>
elementRefs
- the element references defining the where conditionUpdate<T> byId(Object idValue)
byId
in interface FilterableStatement<T extends StructuredType<?>,Update<T extends StructuredType<?>>>
idValue
- the value of the target entity's key elementCopyright © 2023 SAP. All rights reserved.