Package com.sap.cds

Interface CdsDataStore


public interface CdsDataStore
The CdsDataStore is used to interact with a data source. It allows to execute CDS QL queries, as well as insert, upsert, update and delete statements.
  • Method Details

    • execute

      Result execute(CqnSelect select, Object... paramValues)
      Executes a CqnSelect statement with optional positional values for indexed parameters, see CQL.param(int).
      Parameters:
      select - the CQN select statement to be executed
      paramValues - the positional parameter values
      Returns:
      the Result of the query
    • execute

      Result execute(CqnSelect select, Map<String,Object> namedValues)
      Executes a CqnSelect statement with values for named parameters, see CQL.param(String).
      Parameters:
      select - the CQN select statement to be executed
      namedValues - the named parameter values
      Returns:
      the Result of the query
    • execute

      @Beta default Result execute(CqnSelect select, Iterable<Map<String,Object>> valueSets)
      Executes a CqnSelect statement as batch with the given named parameter values. Named parameters are required either in the where clause, or in one infix filter of the from clause. If the number of entries in valueSets is larger than the default batch size, the select statement is executed multiple times and the result sets are combined, in this case order by clauses are not supported and an exception is thrown.
      Parameters:
      select - the CQN select statement to be executed
      valueSets - the named parameter value sets
      Returns:
      the Result of the batch select
    • execute

      @Beta Result execute(CqnSelect select, Iterable<Map<String,Object>> valueSets, int maxBatchSize)
      Executes a CqnSelect statement as batch with the given named parameter values. Named parameters are required either in the where clause, or in one infix filter of the from clause. If the number of entries in valueSets is larger than maxBatchSize, the select statement is executed multiple times and the result sets are combined, in this case order by clauses are not supported and an exception is thrown.
      Parameters:
      select - the CQN select statement to be executed
      valueSets - the named parameter value sets
      maxBatchSize - the maximum batch size
      Returns:
      the Result of the batch select
    • execute

      Result execute(CqnInsert insert)
      Executes a CqnInsert statement.
      Parameters:
      insert - the CQN insert statement to be executed
      Returns:
      the Result of the insert
    • execute

      Result execute(CqnUpsert upsert)
      Executes a CqnUpsert statement.
      Parameters:
      upsert - the CQN upsert statement to be executed
      Returns:
      the Result of the upsert
    • execute

      default Result execute(CqnUpdate update)
      Executes a CqnUpdate statement.
      Parameters:
      update - the CQN update statement to be executed
      Returns:
      the Result of the update
    • execute

      Result execute(CqnUpdate update, Object... paramValues)
      Executes a CqnUpdate statement with optional positional values for indexed parameters, see CQL.param(int).
      Parameters:
      update - the CQN update statement to be executed
      paramValues - the positional parameter values
      Returns:
      the Result of the update
    • execute

      Result execute(CqnUpdate update, Map<String,Object> namedValues)
      Executes a CqnUpdate statement with values for named parameters, see CQL.param(String).
      Parameters:
      update - the CQN update statement to be executed
      namedValues - the named parameter values
      Returns:
      the Result of the update
    • execute

      Result execute(CqnUpdate update, Iterable<Map<String,Object>> valueSets)
      Executes a CqnUpdate statement as batch with the given named parameter values.
      Parameters:
      update - the CQN update statement to be executed
      valueSets - the named parameter value sets
      Returns:
      the Result of the batch update
    • execute

      default Result execute(CqnDelete delete)
      Executes a CqnDelete statement .
      Parameters:
      delete - the CQN delete statement to be executed
      Returns:
      the Result of the delete
    • execute

      Result execute(CqnDelete delete, Object... paramValues)
      Executes a CqnDelete statement with optional positional values for indexed parameters, see CQL.param(int).
      Parameters:
      delete - the CQN delete statement to be executed
      paramValues - the positional parameter values
      Returns:
      the Result of the delete
    • execute

      Result execute(CqnDelete delete, Map<String,Object> namedValues)
      Executes a CqnDelete statement with values for named parameters, see CQL.param(String).
      Parameters:
      delete - the CQN delete statement to be executed
      namedValues - the named parameter values
      Returns:
      the Result of the delete
    • execute

      Result execute(CqnDelete delete, Iterable<Map<String,Object>> valueSets)
      Executes a CqnDelete statement as batch with the given named parameter values.
      Parameters:
      delete - the CQN delete statement to be executed
      valueSets - the named parameter value sets
      Returns:
      the Result of the batch delete
    • getSessionContext

      SessionContext getSessionContext()
    • setSessionContext

      void setSessionContext(SessionContext session)