Interface DraftService

All Superinterfaces:
ApplicationService, CqnService, Service

public interface DraftService extends ApplicationService
An ApplicationService that handles draft enabled entities.
  • Field Details

  • Method Details

    • saveDraft

      com.sap.cds.Result saveDraft(com.sap.cds.ql.cqn.CqnSelect select, Object... paramValues)
      Saves a draft. That is, in case no active entity is existing it will be created from the draft. Otherwise it will be overwritten by the draft and the draft entity will be deleted.
      Parameters:
      select - the select statement specifying the entity to save
      paramValues - the optional positional parameter values
      Returns:
      the Result
    • saveDraft

      com.sap.cds.Result saveDraft(com.sap.cds.ql.cqn.CqnSelect select, Map<String,Object> namedValues)
      Saves a draft. That is, in case no active entity is existing it will be created from the draft. Otherwise it will be overwritten by the draft and the draft entity will be deleted.
      Parameters:
      select - the select statement specifying the entity to save
      namedValues - the named parameter values
      Returns:
      the Result
    • prepareDraft

      com.sap.cds.Result prepareDraft(com.sap.cds.ql.cqn.CqnSelect select, String sideEffectsQualifier, Object... paramValues)
      Executes checks to validate the current draft entity.
      Parameters:
      select - the statement specifying the draft to prepare
      sideEffectsQualifier - the side effects qualifier
      paramValues - the optional positional parameter values
      Returns:
      the Result
    • prepareDraft

      com.sap.cds.Result prepareDraft(com.sap.cds.ql.cqn.CqnSelect select, String sideEffectsQualifier, Map<String,Object> namedValues)
      Executes checks to validate the current draft entity.
      Parameters:
      select - the statement specifying the draft to prepare
      sideEffectsQualifier - the side effects qualifier
      namedValues - the named parameter values
      Returns:
      the Result
    • editDraft

      com.sap.cds.Result editDraft(com.sap.cds.ql.cqn.CqnSelect select, boolean preserveChanges, Object... paramValues)
      Creates a new draft entity from an active entity.
      Parameters:
      select - the statement specifying the active entity to edit
      preserveChanges - if true changes will be preserved
      paramValues - the optional positional parameter values
      Returns:
      the Result
    • editDraft

      com.sap.cds.Result editDraft(com.sap.cds.ql.cqn.CqnSelect select, boolean preserveChanges, Map<String,Object> namedValues)
      Creates a new draft entity from an active entity.
      Parameters:
      select - the statement specifying the active entity to edit
      preserveChanges - if true changes will be preserved
      namedValues - the named parameter values
      Returns:
      the Result
    • newDraft

      com.sap.cds.Result newDraft(com.sap.cds.ql.cqn.CqnInsert insert)
      Creates a new draft entity by executing the insert statement.
      Parameters:
      insert - the statement to execute
      Returns:
      the Result of the insert
    • patchDraft

      com.sap.cds.Result patchDraft(com.sap.cds.ql.cqn.CqnUpdate update, Object... paramValues)
      Updates draft entities by executing the update statement.
      Parameters:
      update - the statement to execute
      paramValues - the optional positional parameter values
      Returns:
      the Result of the update
    • patchDraft

      com.sap.cds.Result patchDraft(com.sap.cds.ql.cqn.CqnUpdate update, Map<String,Object> namedValues)
      Updates draft entities by executing the update statement.
      Parameters:
      update - the statement to execute
      namedValues - the named parameter values
      Returns:
      the Result of the update
    • patchDraft

      com.sap.cds.Result patchDraft(com.sap.cds.ql.cqn.CqnUpdate update, Iterable<Map<String,Object>> valueSets)
      Updates draft entities by executing the update statement.
      Parameters:
      update - the statement to execute
      valueSets - the named parameter values
      Returns:
      the Result of the update
    • cancelDraft

      com.sap.cds.Result cancelDraft(com.sap.cds.ql.cqn.CqnDelete delete, Object... paramValues)
      Deletes draft entities by executing the provided delete statement.
      Parameters:
      delete - the CqnDelete to be executed
      paramValues - the optional positional parameter values
      Returns:
      the Result of the delete
    • cancelDraft

      com.sap.cds.Result cancelDraft(com.sap.cds.ql.cqn.CqnDelete delete, Map<String,Object> namedValues)
      Deletes draft entities by executing the provided delete statement.
      Parameters:
      delete - the CqnDelete to be executed
      namedValues - the named parameter values
      Returns:
      the Result of the delete
    • cancelDraft

      com.sap.cds.Result cancelDraft(com.sap.cds.ql.cqn.CqnDelete delete, Iterable<Map<String,Object>> valueSets)
      Deletes draft entities by executing the provided delete statement.
      Parameters:
      delete - the statement to execute
      valueSets - the named parameter values
      Returns:
      the Result of the delete
    • gcDrafts

      com.sap.cds.Result gcDrafts()
      This method deletes all drafts that exist longer than the draft deletion timeout (cds.drafts.deletionTimeout).
      Returns:
      the Result containing the number of deleted entries