Package com.sap.cds.services.draft
Interface DraftService
- All Superinterfaces:
ApplicationService,CqnService,Service
An
ApplicationService that handles draft enabled entities.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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.ResultcancelDraft(com.sap.cds.ql.cqn.CqnDelete delete, Iterable<Map<String, Object>> valueSets) Deletes draft entities by executing the provideddeletestatement.com.sap.cds.ResultcancelDraft(com.sap.cds.ql.cqn.CqnDelete delete, Object... paramValues) Deletes draft entities by executing the provideddeletestatement.com.sap.cds.ResultcancelDraft(com.sap.cds.ql.cqn.CqnDelete delete, Map<String, Object> namedValues) Deletes draft entities by executing the provideddeletestatement.com.sap.cds.ResultCreates a new draft entity from an active entity.com.sap.cds.ResulteditDraft(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.ResultgcDrafts()This method deletes all drafts that exist longer than the draft deletion timeout (cds.drafts.deletionTimeout).com.sap.cds.ResultnewDraft(com.sap.cds.ql.cqn.CqnInsert insert) Creates a new draft entity by executing theinsertstatement.com.sap.cds.ResultpatchDraft(com.sap.cds.ql.cqn.CqnUpdate update, Iterable<Map<String, Object>> valueSets) Updates draft entities by executing theupdatestatement.com.sap.cds.ResultpatchDraft(com.sap.cds.ql.cqn.CqnUpdate update, Object... paramValues) Updates draft entities by executing theupdatestatement.com.sap.cds.ResultpatchDraft(com.sap.cds.ql.cqn.CqnUpdate update, Map<String, Object> namedValues) Updates draft entities by executing theupdatestatement.com.sap.cds.ResultprepareDraft(com.sap.cds.ql.cqn.CqnSelect select, String sideEffectsQualifier, Object... paramValues) Executes checks to validate the current draft entity.com.sap.cds.ResultprepareDraft(com.sap.cds.ql.cqn.CqnSelect select, String sideEffectsQualifier, Map<String, Object> namedValues) Executes checks to validate the current draft entity.com.sap.cds.ResultSaves a draft.com.sap.cds.ResultSaves 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_GC
- See Also:
-
EVENT_ACTIVE_READ
- See Also:
-
EVENT_DRAFT_READ
- See Also:
-
EVENT_DRAFT_CREATE
- 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- iftruechanges 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- iftruechanges 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 theinsertstatement.- Parameters:
insert- the statement to execute- Returns:
- the
Resultof the insert
-
patchDraft
Updates draft entities by executing theupdatestatement.- Parameters:
update- the statement to executeparamValues- the optional positional parameter values- Returns:
- the
Resultof the update
-
patchDraft
Updates draft entities by executing theupdatestatement.- Parameters:
update- the statement to executenamedValues- the named parameter values- Returns:
- the
Resultof 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 theupdatestatement.- Parameters:
update- the statement to executevalueSets- the named parameter values- Returns:
- the
Resultof the update
-
cancelDraft
Deletes draft entities by executing the provideddeletestatement.- Parameters:
delete- theCqnDeleteto be executedparamValues- the optional positional parameter values- Returns:
- the
Resultof the delete
-
cancelDraft
Deletes draft entities by executing the provideddeletestatement.- Parameters:
delete- theCqnDeleteto be executednamedValues- the named parameter values- Returns:
- the
Resultof 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 provideddeletestatement.- Parameters:
delete- the statement to executevalueSets- the named parameter values- Returns:
- the
Resultof 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
Resultcontaining the number of deleted entries
-