Class PrivilegedEntityHashModel

java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.templatemodel.PrivilegedEntityHashModel
All Implemented Interfaces:
EntityHashModel

public class PrivilegedEntityHashModel extends Object implements EntityHashModel
This is a wrapper for EntityHashModel which simply delegates all calls in privileged mode.
  • Constructor Details

  • Method Details

    • getNiceEntity

      @Nullable public @Nullable Entity getNiceEntity()
      Specified by:
      getNiceEntity in interface EntityHashModel
    • get

      public Object get(String key)
      Description copied from interface: EntityHashModel
      Getter to handle field and relation access to the underlying Entity
      Specified by:
      get in interface EntityHashModel
      Parameters:
      key - a field or relation name
      Returns:
      the requested field or relation value
    • resolve

      public EntityList resolve(String relation, String orderBy)
      Description copied from interface: EntityHashModel
      Resolve a relation while providing an ordering
      Specified by:
      resolve in interface EntityHashModel
      Parameters:
      relation - the relation to be resolved
      orderBy - an ordering clause
      Returns:
      the resulting entity list
    • resolve

      public EntityList resolve(String relation, String orderBy, @Nullable @Nullable String where)
      Description copied from interface: EntityHashModel
      Resolve a relation with ordering and a condition.
      Specified by:
      resolve in interface EntityHashModel
      Parameters:
      relation - the relation to be resolved
      orderBy - an ordering clause
      where - the where clause
      Returns:
      the resulting entity list
    • display

      public String display()
      Description copied from interface: EntityHashModel
      Get the default display of the entity.
      Specified by:
      display in interface EntityHashModel
      Returns:
      the default display fo the entity.
    • display

      public String display(String type)
      Description copied from interface: EntityHashModel
      Get the default display of the entity.
      Specified by:
      display in interface EntityHashModel
      Parameters:
      type - display type name
      Returns:
      the default display fo the entity.
      See Also:
    • model

      public String model()
      Description copied from interface: EntityHashModel
      Get the model name of the entity.
      Specified by:
      model in interface EntityHashModel
      Returns:
      the name of the model.
    • exists

      public boolean exists()
      Description copied from interface: EntityHashModel
      Check if entity exists.
      Specified by:
      exists in interface EntityHashModel
      Returns:
      true if it exists, false if not.
    • fieldExists

      public boolean fieldExists(String name)
      Description copied from interface: EntityHashModel
      Check if a field exists on the model.
      Specified by:
      fieldExists in interface EntityHashModel
      Returns:
      true if it exists, false if not.
    • relationExists

      public boolean relationExists(String name)
      Description copied from interface: EntityHashModel
      Check if a relation exists on the model.
      Specified by:
      relationExists in interface EntityHashModel
      Returns:
      true if it exists, false if not.