Interface Insert

All Superinterfaces:
CqnInsert, CqnStatement, CqnXsert, JSONizable, Statement<Insert>

public interface Insert extends CqnInsert, Statement<Insert>
The Insert builder allows to construct CDS QL insert statements, which can be executed via the CdsDataStore.
  • Method Details

    • into

      static Insert into(String qualifiedName)
      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

      static Insert into(CqnStructuredTypeRef ref)
      Creates an insert statement to insert entries into a specified entity set.
      Parameters:
      ref - the ref to the entity
      Returns:
      the insert statement
    • into

      static <E extends StructuredType<?>> Insert into(E entity)
      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

      static Insert into(String entityName, UnaryOperator<StructuredType<?>> path)
      Creates an insert statement to insert entries into a specified entity set.
      Parameters:
      entityName - the root entity name of the path expression
      path - a path expression navigating from the root entity to the target entity of the insert statement
      Returns:
      the insert statement
    • into

      static <E extends StructuredType<E>> Insert into(Class<E> entity)
      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 entity
      T - the type of the target entity
      Parameters:
      entity - the static model representation of the entity set
      path - a path expression navigating from the root entity to the target entity of the insert statement
      Returns:
      the insert statement
    • into

      static Insert into(CdsEntity entity)
      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

      static Insert copy(CqnInsert insert)
      Copies the given CqnInsert into an Insert builder.
      Parameters:
      insert - the CqnInsert to be copied
      Returns:
      the modifiable insert statement copy
    • cqn

      static Insert cqn(CdsModel model, String cqnInsert)
      Creates an insert statement from a given CQN String.
      Parameters:
      model - the CDS model
      cqnInsert - the CQN representation of the insert statement
      Returns:
      the insert statement
    • entries

      Insert entries(Iterable<? extends Map<String,?>> 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

      Insert entry(Map<String,?> 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

      Insert entry(String elementName, Object value)
      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 inserted
      value - the data to be inserted for the element
      Returns:
      the insert statement