Package com.sap.cds.services.utils
Class DraftUtils
java.lang.Object
com.sap.cds.services.utils.DraftUtils
Utility class for the draft handling.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isDraftEnabled
(com.sap.cds.reflect.CdsAnnotatable entity) Checks if the entity is draft enabled.static boolean
isDraftEnabled
(String serviceName, com.sap.cds.reflect.CdsModel model) Checks if the service has a draft enabled entity.static boolean
isDraftRoot
(com.sap.cds.reflect.CdsAnnotatable entity) static boolean
isDraftTarget
(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsEntity entity, com.sap.cds.reflect.CdsModel model) Checks is the ref points to a draft instance.
-
Method Details
-
isDraftEnabled
Checks if the service has a draft enabled entity.- Parameters:
serviceName
- the service namemodel
- the model- Returns:
true
if the service has a draft enabled entity
-
isDraftTarget
public static boolean isDraftTarget(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsEntity entity, com.sap.cds.reflect.CdsModel model) Checks is the ref points to a draft instance.- Parameters:
ref
- the entity refentity
- the entity typemodel
- the model- Returns:
- true, if the ref points to a draft instance
-
isDraftEnabled
public static boolean isDraftEnabled(com.sap.cds.reflect.CdsAnnotatable entity) Checks if the entity is draft enabled.- Parameters:
entity
- the entity- Returns:
true
if the entity is draft enabled
-
isDraftRoot
public static boolean isDraftRoot(com.sap.cds.reflect.CdsAnnotatable entity)
-