Interface EntityConfiguration<T>

Type Parameters:
T - type of the entity
All Superinterfaces:
EntityViewRegistry, com.foreach.across.core.support.ReadableAttributes
All Known Subinterfaces:
MutableEntityConfiguration<T>
All Known Implementing Classes:
EntityConfigurationImpl

public interface EntityConfiguration<T> extends com.foreach.across.core.support.ReadableAttributes, EntityViewRegistry
Central configuration API for a single entity type in a EntityRegistry. Usually an entity is represented by a unique Class, but this is not a requirement. As a EntityRegistry identifies entity configurations uniquely by name, it is entirely possible to have more than one configuration for the same class.

Every configuration is expected to have a EntityPropertyRegistry attached, that can be used to query the available properties of a single entity instance.

Usually a configuration will also have a simple EntityModel set. This is a basic repository for querying and persisting an entity. If no model is present, functionality will be limited.

Since:
1.0.0
See Also:
  • Method Details

    • getName

      String getName()
      Returns:
      unique name for this configuration
    • getDisplayName

      String getDisplayName()
      Returns:
      default display name to use in the UI
      See Also:
    • getEntityType

      Class<? extends T> getEntityType()
      Returns:
      simple class that instances of this entity are.
    • getEntityModel

      EntityModel<T,Serializable> getEntityModel()
      Returns:
      basic model for performing entity operations
    • hasEntityModel

      boolean hasEntityModel()
      Returns:
      true if this configuration actually has an entity model configured
    • getPropertyRegistry

      EntityPropertyRegistry getPropertyRegistry()
      Returns:
      property registry for this entity
    • getEntityMessageCodeResolver

      EntityMessageCodeResolver getEntityMessageCodeResolver()
      Returns:
      message code resolver to use for resolving messages in the context of this entity type
    • getAssociations

      Collection<EntityAssociation> getAssociations()
      Returns:
      list of associations this entity has to others
    • association

      EntityAssociation association(String name)
      Get a uniquely named association.
      Parameters:
      name - of the association
      Returns:
      specific association with that name
    • isNew

      boolean isNew(T entity)
      Shortcut to EntityInformation.isNew(Object).
      Parameters:
      entity - instance
      Returns:
      true if new (unsaved) entity instance
    • getIdType

      Class<?> getIdType()
      Shortcut to EntityInformation.getIdType()}.
      Returns:
      type of the id parameter of this entity (can be null)
    • getId

      Serializable getId(T entity)
      Shortcut to EntityInformation.getId(Object).
      Parameters:
      entity - instance
      Returns:
      id value of the entity
    • getLabel

      String getLabel(T entity)
      Parameters:
      entity - instance
      Returns:
      label valud of the entity
    • isHidden

      boolean isHidden()
      Returns:
      true if this configuration should not be displayed in UI implementations
    • getAllowableActions

      com.foreach.across.modules.spring.security.actions.AllowableActions getAllowableActions()
      Returns:
      the set of actions allowed on all entities of this EntityConfiguration
    • getAllowableActions

      com.foreach.across.modules.spring.security.actions.AllowableActions getAllowableActions(T entity)
      Parameters:
      entity - for which to fetch the allowed actions
      Returns:
      the set of actions allowed on the specific entity