public interface CdsRuntime
Service
instances and CdsModel
.
It can be used to define Request and ChangeSet boundaries.Modifier and Type | Method and Description |
---|---|
com.sap.cds.reflect.CdsModel |
getCdsModel() |
com.sap.cds.reflect.CdsModel |
getCdsModel(String tenant) |
ServiceCatalog |
getServiceCatalog() |
<T> T |
runInChangeSetContext(Function<ChangeSetContext,T> changeSetHandler)
Opens a
ChangeSetContext and runs the given handler within its scope. |
<T> T |
runInRequestContext(Request request,
Function<RequestContext,T> requestHandler)
Opens a
RequestContext and runs the given handler within its scope. |
ServiceCatalog getServiceCatalog()
ServiceCatalog
containing all registered Service
instancescom.sap.cds.reflect.CdsModel getCdsModel()
CdsModel
as read from CSN filecom.sap.cds.reflect.CdsModel getCdsModel(String tenant)
tenant
- the tenanttenant
is null
<T> T runInRequestContext(Request request, Function<RequestContext,T> requestHandler)
RequestContext
and runs the given handler within its scope.
The RequestContext
will be propagated to all
EventContext
instances in the service call
hierarchy.T
- The type of the responserequest
- A Request
object describing the context of the request like parameters, user etc.requestHandler
- The handler for processing the request within the context<T> T runInChangeSetContext(Function<ChangeSetContext,T> changeSetHandler)
ChangeSetContext
and runs the given handler within its scope.
The ChangeSetContext
marks a scope in which all opened transactions
etc. are committed cancelled together. Note that single transactions may fail
during commit but others might be successful.
The ChangeSetContext
will be propagated to all
EventContext
instances in the service call
hierarchy.
T
- The type of the responsechangeSetHandler
- The handler for processing the request within the
contextCopyright © 2020. All rights reserved.