Class DraftUtils

java.lang.Object
com.sap.cds.services.utils.DraftUtils

public class DraftUtils extends Object
Utility class for the draft handling.
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isDraftEnabled

      public static boolean isDraftEnabled(String serviceName, com.sap.cds.reflect.CdsModel model)
      Checks if the service has a draft enabled entity.
      Parameters:
      serviceName - the service name
      model - 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 ref
      entity - the entity type
      model - 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)