Class EntityHashModelImpl

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

public class EntityHashModelImpl extends Object implements EntityHashModel
  • Constructor Details

  • Method Details

    • get

      public Object get(String key) throws freemarker.template.TemplateModelException
      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
      Throws:
      freemarker.template.TemplateModelException
    • 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
    • getNiceEntity

      @Nullable public @Nullable Entity getNiceEntity()
      Specified by:
      getNiceEntity in interface EntityHashModel
    • 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.