Package com.sap.cds.services.draft
Interface DraftService
- All Superinterfaces:
ApplicationService
,CqnService
,Service
An
ApplicationService
that handles draft enabled entities.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface com.sap.cds.services.cds.CqnService
EVENT_CREATE, EVENT_DELETE, EVENT_READ, EVENT_UPDATE, EVENT_UPSERT
-
Method Summary
Modifier and TypeMethodDescriptioncom.sap.cds.Result
cancelDraft
(com.sap.cds.ql.cqn.CqnDelete delete, Iterable<Map<String, Object>> valueSets) Deletes draft entities by executing the provideddelete
statement.com.sap.cds.Result
cancelDraft
(com.sap.cds.ql.cqn.CqnDelete delete, Object... paramValues) Deletes draft entities by executing the provideddelete
statement.com.sap.cds.Result
cancelDraft
(com.sap.cds.ql.cqn.CqnDelete delete, Map<String, Object> namedValues) Deletes draft entities by executing the provideddelete
statement.com.sap.cds.Result
Creates a new draft entity from an active entity.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.com.sap.cds.Result
gcDrafts()
This method deletes all drafts that exist longer than the draft deletion timeout (cds.drafts.deletionTimeout
).com.sap.cds.Result
newDraft
(com.sap.cds.ql.cqn.CqnInsert insert) Creates a new draft entity by executing theinsert
statement.com.sap.cds.Result
patchDraft
(com.sap.cds.ql.cqn.CqnUpdate update, Iterable<Map<String, Object>> valueSets) Updates draft entities by executing theupdate
statement.com.sap.cds.Result
patchDraft
(com.sap.cds.ql.cqn.CqnUpdate update, Object... paramValues) Updates draft entities by executing theupdate
statement.com.sap.cds.Result
patchDraft
(com.sap.cds.ql.cqn.CqnUpdate update, Map<String, Object> namedValues) Updates draft entities by executing theupdate
statement.com.sap.cds.Result
prepareDraft
(com.sap.cds.ql.cqn.CqnSelect select, String sideEffectsQualifier, Object... paramValues) Executes checks to validate the current draft entity.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.com.sap.cds.Result
Saves a draft.com.sap.cds.Result
Saves a draft.Methods inherited from interface com.sap.cds.services.cds.ApplicationService
getDefinition
-
Field Details
-
EVENT_DRAFT_EDIT
- See Also:
-
EVENT_DRAFT_PREPARE
- See Also:
-
EVENT_DRAFT_SAVE
- See Also:
-
EVENT_DRAFT_NEW
- See Also:
-
EVENT_DRAFT_PATCH
- See Also:
-
EVENT_DRAFT_CANCEL
- See Also:
-
EVENT_DRAFT_CREATE
- See Also:
-
EVENT_DRAFT_GC
- See Also:
-
-
Method Details
-
saveDraft
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 saveparamValues
- the optional positional parameter values- Returns:
- the
Result
-
saveDraft
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 savenamedValues
- 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 preparesideEffectsQualifier
- the side effects qualifierparamValues
- 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 preparesideEffectsQualifier
- the side effects qualifiernamedValues
- 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 editpreserveChanges
- iftrue
changes will be preservedparamValues
- 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 editpreserveChanges
- iftrue
changes will be preservednamedValues
- 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 theinsert
statement.- Parameters:
insert
- the statement to execute- Returns:
- the
Result
of the insert
-
patchDraft
Updates draft entities by executing theupdate
statement.- Parameters:
update
- the statement to executeparamValues
- the optional positional parameter values- Returns:
- the
Result
of the update
-
patchDraft
Updates draft entities by executing theupdate
statement.- Parameters:
update
- the statement to executenamedValues
- 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 theupdate
statement.- Parameters:
update
- the statement to executevalueSets
- the named parameter values- Returns:
- the
Result
of the update
-
cancelDraft
Deletes draft entities by executing the provideddelete
statement.- Parameters:
delete
- theCqnDelete
to be executedparamValues
- the optional positional parameter values- Returns:
- the
Result
of the delete
-
cancelDraft
Deletes draft entities by executing the provideddelete
statement.- Parameters:
delete
- theCqnDelete
to be executednamedValues
- 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 provideddelete
statement.- Parameters:
delete
- the statement to executevalueSets
- 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
-