Class DraftUtils

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

public class DraftUtils extends Object
Utility class for the draft handling.
  • 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)
    • gcDraftsOfAllServices

      public static void gcDraftsOfAllServices(CdsRuntime runtime)
    • gcDraftsOfAllServicesAndTenants

      public static void gcDraftsOfAllServicesAndTenants(CdsRuntime runtime)