Package com.sap.cds.ql
Interface Insert
- All Superinterfaces:
CqnInsert
,CqnStatement
,CqnXsert
,JSONizable
,Statement<Insert>
The Insert builder allows to construct CDS QL insert statements, which can be
executed via the
CdsDataStore
.-
Method Summary
Modifier and TypeMethodDescriptionstatic Insert
static Insert
Creates an insert statement from a given CQN String.Sets the entries to be inserted into the entity set.Add a single entry to be inserted into the entity set.Add a single entry to be inserted into the entity set.static Insert
into
(CqnStructuredTypeRef ref) Creates an insert statement to insert entries into a specified entity set.static Insert
Creates an insert statement to insert entries into a specified entity set.static <E extends StructuredType<?>>
Insertinto
(E entity) Creates an insert statement to insert entries into a specified entity set.static <E extends StructuredType<E>>
InsertCreates an insert statement to insert entries into a specified entity set.static <R extends StructuredType<R>,
T extends StructuredType<T>>
InsertCreates an insert statement to insert entries into a specified entity set.static Insert
Creates an insert statement to insert entries into a specified entity set.static Insert
into
(String entityName, UnaryOperator<StructuredType<?>> path) Creates an insert statement to insert entries into a specified entity set.Methods inherited from interface com.sap.cds.ql.cqn.CqnStatement
asDelete, asSelect, asUpdate, asUpsert, hints, isDelete, isSelect, isUpdate, isUpsert, ref
Methods inherited from interface com.sap.cds.JSONizable
toJson
-
Method Details
-
into
Creates an insert statement to insert entries into a specified entity set.- Parameters:
qualifiedName
- the fully qualified name of the CDS entity set- Returns:
- the insert statement
-
into
Creates an insert statement to insert entries into a specified entity set.- Parameters:
ref
- the ref to the entity- Returns:
- the insert statement
-
into
Creates an insert statement to insert entries into a specified entity set.- Type Parameters:
E
- the type of the entity set- Parameters:
entity
- the structured type representing the entity set- Returns:
- the insert statement
-
into
Creates an insert statement to insert entries into a specified entity set.- Parameters:
entityName
- the root entity name of the path expressionpath
- a path expression navigating from the root entity to the target entity of the insert statement- Returns:
- the insert statement
-
into
Creates an insert statement to insert entries into a specified entity set.- Type Parameters:
E
- the type of the entity set- Parameters:
entity
- the static model representation of the entity set- Returns:
- the insert statement
-
into
static <R extends StructuredType<R>,T extends StructuredType<T>> Insert into(Class<R> entity, Function<R, T> path) Creates an insert statement to insert entries into a specified entity set.- Type Parameters:
R
- the type of the root entityT
- the type of the target entity- Parameters:
entity
- the static model representation of the entity setpath
- a path expression navigating from the root entity to the target entity of the insert statement- Returns:
- the insert statement
-
into
Creates an insert statement to insert entries into a specified entity set.- Parameters:
entity
- the model representation of the entity set obtained by reflection- Returns:
- the insert statement
- See Also:
-
copy
- Parameters:
insert
- theCqnInsert
to be copied- Returns:
- the modifiable insert statement copy
-
cqn
Creates an insert statement from a given CQN String.- Parameters:
model
- the CDS modelcqnInsert
- the CQN representation of the insert statement- Returns:
- the insert statement
-
entries
Sets the entries to be inserted into the entity set.- Parameters:
entries
- a collection of data where every element is the canonical representation- Returns:
- the insert statement
-
entry
Add a single entry to be inserted into the entity set. The data is given as a Map<String, Object> that maps element names of the target entity set to the values to be inserted.The value can be deeply structured to represent a structured document:
- for single-valued relationships the value of the element is of type Map<String, Object>
- for collection-valued relationships the value of the element is of type List<Map<String, Object>>
- Parameters:
entry
- the data to be inserted as a map- Returns:
- the insert statement
-
entry
Add a single entry to be inserted into the entity set.The value can be deeply structured to represent a structured document:
- for single-valued relationships the value of the element is of type Map<String, Object>
- for collection-valued relationships the value of the element is of type List<Map<String, Object>>
- Parameters:
elementName
- the element name of the target entity for the value to be insertedvalue
- the data to be inserted for the element- Returns:
- the insert statement
-