public interface Upsert extends CqnUpsert, Statement<Upsert>
CdsDataStore
.
An Upsert statement updates an entity from the given data. The key of the entity
that is upserted is expected to be in the data. If the entity doesn't exist and the key
is given in the data, it inserts a new entry.CqnXsert.Kind
Modifier and Type | Method and Description |
---|---|
static Upsert |
copy(CqnUpsert upsert)
|
static Upsert |
cqn(String cqnUpsert)
Creates an upsert statement to upsert data for a specified entity set.
|
Upsert |
entries(Iterable<? extends Map<String,?>> entries)
Sets the batch data to be inserted or updated by the upsert statement.
|
Upsert |
entry(Map<String,?> entry)
Adds a single entry to be upserted into the entity set.
|
Upsert |
entry(String elementName,
Object value)
Adds a single entry to be upserted into the entity set.
|
static Upsert |
into(CdsEntity entity)
Creates an upsert statement to upsert entries into a specified entity set.
|
static Upsert |
into(CdsEntity entity,
UnaryOperator<StructuredType<?>> path)
Creates an upsert statement to upsert entries into a specified entity set.
|
static <R extends StructuredType<R>,T extends StructuredType<T>> |
into(Class<R> entity,
Function<R,T> path)
Creates an upsert statement to upsert entries into a specified entity set.
|
static <T extends StructuredType<T>> |
into(Class<T> entity)
Creates an upsert statement to upsert entries into a specified entity set.
|
static Upsert |
into(CqnStructuredTypeRef ref)
Creates an upsert statement to upsert entries into a specified entity set.
|
static Upsert |
into(String qualifiedName)
Creates an upsert statement to upsert entries into a specified entity set.
|
static Upsert |
into(String qualifiedName,
UnaryOperator<StructuredType<?>> path)
Creates an upsert statement to upsert entries into a specified entity set.
|
static <T extends StructuredType<?>> |
into(T entity)
Creates an upsert statement to upsert entries into a specified entity set.
|
asDelete, asInsert, asSelect, asUpdate, hints, isDelete, isInsert, isSelect, isUpdate, ref
toJson
static Upsert into(String qualifiedName)
qualifiedName
- the fully qualified name of the CDS entity setstatic Upsert into(CqnStructuredTypeRef ref)
ref
- the ref to the entitystatic <T extends StructuredType<?>> Upsert into(T entity)
T
- the type of the entity setentity
- the structured type representing the entity setstatic Upsert into(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 upsert statementstatic <T extends StructuredType<T>> Upsert into(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>> Upsert into(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 upsert statementstatic Upsert into(CdsEntity entity)
entity
- the model representation of the entity set obtained by
reflectionCdsModel.findEntity(String)
,
CdsModel.entities()
static Upsert into(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 upsert statementCdsModel.findEntity(String)
,
CdsModel.entities()
static Upsert copy(CqnUpsert upsert)
upsert
- the CqnUpsert
to be copiedstatic Upsert cqn(String cqnUpsert)
cqnUpsert
- the CQN representation of the upsert statementUpsert entries(Iterable<? extends Map<String,?>> entries)
entries
- a collection of data where every element is the canonical
representationUpsert entry(Map<String,?> entry)
The value can be deeply structured to represent a structured document:
entry
- the data to be upserted as a mapUpsert entry(String elementName, Object value)
The value can be deeply structured to represent a structured document:
elementName
- the element name of the target entity for the value to be
upsertedvalue
- the data to be upserted for the elementCopyright © 2023 SAP. All rights reserved.