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 Summary
Modifier and TypeMethodDescriptionassociation
(String name) Get a uniquely named association.com.foreach.across.modules.spring.security.actions.AllowableActions
com.foreach.across.modules.spring.security.actions.AllowableActions
getAllowableActions
(T entity) Shortcut toEntityInformation.getId(Object)
.Class<?>
Shortcut toEntityInformation.getIdType()
}.Shortcut toEntityModel.getLabel(Object)
.getName()
boolean
boolean
isHidden()
boolean
Shortcut toEntityInformation.isNew(Object)
.Methods inherited from interface com.foreach.across.modules.entity.registry.EntityViewRegistry
getViewFactory, getViewNames, hasView
Methods inherited from interface com.foreach.across.core.support.ReadableAttributes
attributeMap, attributeNames, getAttribute, getAttribute, getAttribute, hasAttribute, hasAttribute
-
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
- 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
Get a uniquely named association.- Parameters:
name
- of the association- Returns:
- specific association with that name
-
isNew
Shortcut toEntityInformation.isNew(Object)
.- Parameters:
entity
- instance- Returns:
- true if new (unsaved) entity instance
-
getIdType
Class<?> getIdType()Shortcut toEntityInformation.getIdType()
}.- Returns:
- type of the id parameter of this entity (can be null)
-
getId
Shortcut toEntityInformation.getId(Object)
.- Parameters:
entity
- instance- Returns:
- id value of the entity
-
getLabel
Shortcut toEntityModel.getLabel(Object)
.- 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
- Parameters:
entity
- for which to fetch the allowed actions- Returns:
- the set of actions allowed on the specific entity
-