public class CdsServiceUtils extends Object
| Constructor and Description |
|---|
CdsServiceUtils() |
| Modifier and Type | Method and Description |
|---|---|
static PersistenceService |
getDefaultPersistenceService(EventContext context)
Returns the default persistence service.
|
static List<Map<String,Object>> |
getEntities(EventContext context)
Returns the list of entity maps present in the
EventContext. |
static List<Map<String,Object>> |
getEntitiesResolved(EventContext context)
Returns the list of entity maps present in the
EventContext. |
static EventContextSPI |
getEventContextSPI(EventContext eventContext)
Returns the EventContext casted to the
EventContextSPI |
static com.sap.cds.Result |
getResult(EventContext context)
Returns the
Result present in the EventContext. |
static ServiceSPI |
getServiceSPI(Service service)
Returns the Service casted to the
ServiceSPI |
public static PersistenceService getDefaultPersistenceService(EventContext context)
context - the current contextpublic static ServiceSPI getServiceSPI(Service service)
ServiceSPIservice - the Service to be castedServiceSPI, or nullpublic static List<Map<String,Object>> getEntities(EventContext context)
EventContext.
This method only works for CqnService.EVENT_CREATE, CqnService.EVENT_UPDATE and CqnService.EVENT_UPSERT.
It inspects the CQN of these events and returns the entity data from it.context - the EventContextEventContextpublic static List<Map<String,Object>> getEntitiesResolved(EventContext context)
EventContext.
This method only works for CqnService.EVENT_CREATE, CqnService.EVENT_UPDATE and CqnService.EVENT_UPSERT.
It inspects the CQN of these events and returns the entity data from it.
In contrast to {link getEntities(EventContext) the data also contains
the resolved foreign keys from parent entities in path expressions.context - the EventContextEventContextpublic static com.sap.cds.Result getResult(EventContext context)
Result present in the EventContext.
This method only works for the default CRUD events.context - the EventContextResult present in the EventContextpublic static EventContextSPI getEventContextSPI(EventContext eventContext)
EventContextSPIeventContext - the EventContext to be castedEventContextSPI, or nullCopyright © 2023. All rights reserved.