Package de.esoco.entity
Klasse EntityRelationTypes
java.lang.Object
de.esoco.entity.EntityRelationTypes
Contains entity-specific relation type declarations and factory methods to
create such relation types.
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungstatic enum
Enumeration of the possible modes for hierarchical queries. -
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final org.obrel.core.RelationType
<Boolean> A flag that indicates that an entity has been placed in the entity cache ofEntityManager
.A mapping from global entity IDs to entities that have been modified within an entity modification context.The set of modified entities that have been successfully updated within an entity modification context but may need to be reset if the enclosing transaction failed.A collection of entities that should be stored if the target entity is stored.static final org.obrel.core.RelationType
<Boolean> A flag to display entity references in annotated entities as IDs instead of describing strings.static final org.obrel.core.RelationType
<de.esoco.lib.property.MutableProperties> Refers to a set of properties that can be used as a parameter annotation to define display properties for the rendering in user interfaces.static final org.obrel.core.RelationType
<Entity> A generic reference to a single entity,A property that contains a list of entity attribute access functions.An entity class.static final org.obrel.core.RelationType
<EntityDefinition.DisplayMode> The mode to be used when displaying entity attributes.static final org.obrel.core.RelationType
<Long> The default attribute for an auto-incremented long integer entity ID.static final org.obrel.core.RelationType
<String> A string identifier that is set on entities to detect concurrent modifications of entities.static final org.obrel.core.RelationType
<de.esoco.lib.expression.Predicate<? super Entity>> A predicate for entities.static final org.obrel.core.RelationType
<de.esoco.storage.QueryPredicate<? extends Entity>> A query predicate for entity storage queries.static final org.obrel.core.RelationType
<de.esoco.lib.expression.Predicate<? super Entity>> A predicate that defines the sort order of entitiesstatic final org.obrel.core.RelationType
<Entity> Will contain the entity that caused the storing of an entity during an invocation ofEntityManager.storeEntity(Entity, Entity)
.A set of tags that categorize an entity.static final org.obrel.core.RelationType
<Boolean> Entity is hidden from display.static final org.obrel.core.RelationType
<EntityRelationTypes.HierarchicalQueryMode> A relation type to set theEntityRelationTypes.HierarchicalQueryMode
on a query predicate.static final org.obrel.core.RelationType
<de.esoco.lib.expression.Predicate<? super Entity>> A predicate that defines the children in a hierarchy.static final org.obrel.core.RelationType
<de.esoco.lib.expression.Predicate<? super Entity>> A predicate that defines the roots of a hierarchy.static final org.obrel.core.RelationType
<Date> The date of the last modification of an entity.static final org.obrel.core.RelationType
<de.esoco.storage.QueryPredicate<? extends Entity>> A previously executed entity query predicate.static final org.obrel.core.RelationType
<Long> The entity ID of an entity's master entity.static final org.obrel.core.RelationType
<Boolean> A flag indicating that an entity is locked for (typically concurrent) modifications.static final org.obrel.core.RelationType
<Boolean> A flag that prevents the locking of an entity byEntityManager
if it is set on the entity.static final org.obrel.core.RelationType
<Long> The entity ID of an entity's parent entity.Child entities that have bee removed from a parent.A mapping from global entity IDs to child entities that have been removed from a parent.static final org.obrel.core.RelationType
<Boolean> Meta-type that marks a relation type that represents the root in a hierarchystatic final org.obrel.core.RelationType
<Boolean> A flag that will skip the automatic change logging of an entity the next time it is stored withEntityManager.storeEntity(Entity, Entity, boolean)
.static final org.obrel.core.RelationType
<Entity> An entity that is targeted by another entity for a certain purpose. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic org.obrel.core.RelationType
<Entity> arbitraryEntityAttribute
(org.obrel.core.RelationTypeModifier... flags) A factory method to create a new relation type for entity attributes that reference arbitrary entity instances.static org.obrel.core.RelationType
<Integer> autoIdAttribute
(org.obrel.core.RelationTypeModifier... flags) Factory method that creates an integer relation type for automatically generated object identifiers.childAttribute
(org.obrel.core.RelationTypeModifier... flags) A factory method that creates a new relation type for relations to a list of child entities.static <T extends Entity>
org.obrel.core.RelationType<T> entityAttribute
(org.obrel.core.RelationTypeModifier... flags) A factory method to create a new relation type for entity attributes that reference an entity instance of a specific entity subclass.static org.obrel.core.RelationType
<Integer> idAttribute
(org.obrel.core.RelationTypeModifier... flags) A factory method that creates an integer relation type for object identifiers.static org.obrel.core.RelationType
<Long> longAutoIdAttribute
(org.obrel.core.RelationTypeModifier... flags) Factory method that creates a long relation type for automatically generated object identifiers.static org.obrel.core.RelationType
<Long> longIdAttribute
(org.obrel.core.RelationTypeModifier... flags) A factory method that creates a long relation type for object identifiers.static <T extends Entity>
org.obrel.core.RelationType<T> parentAttribute
(org.obrel.core.RelationTypeModifier... flags) A factory method that creates a new relation type for relations to the parent entity in a hierarchy.static <T extends Entity>
org.obrel.core.RelationType<T> rootAttribute
(org.obrel.core.RelationTypeModifier... flags) Creates a new relation type for the root entity in a hierarchy similar toparentAttribute(RelationTypeModifier...)
.static void
setAttributeDisplayFlag
(de.esoco.lib.property.PropertyName<Boolean> property, org.obrel.core.RelationType<?>... attributes) Convenience method to set a boolean display property.static void
setAttributeDisplayProperty
(int value, de.esoco.lib.property.PropertyName<Integer> property, org.obrel.core.RelationType<?>... attributes) Convenience method to set an integer display property.static <T> void
setAttributeDisplayProperty
(de.esoco.lib.property.PropertyName<T> property, T value, org.obrel.core.RelationType<?>... attributes) Helper method for subclasses to set a display property on attributes.
-
Felddetails
-
ROOT_ATTRIBUTE
Meta-type that marks a relation type that represents the root in a hierarchy -
CACHE_ENTITY
A flag that indicates that an entity has been placed in the entity cache ofEntityManager
. -
PARENT_ENTITY_ID
The entity ID of an entity's parent entity. -
MASTER_ENTITY_ID
The entity ID of an entity's master entity. -
ENTITY
A generic reference to a single entity, -
ENTITY_CLASS
An entity class. -
ENTITY_PREDICATE
public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> ENTITY_PREDICATEA predicate for entities. -
ENTITY_QUERY_PREDICATE
public static final org.obrel.core.RelationType<de.esoco.storage.QueryPredicate<? extends Entity>> ENTITY_QUERY_PREDICATEA query predicate for entity storage queries. -
LAST_ENTITY_QUERY_PREDICATE
public static final org.obrel.core.RelationType<de.esoco.storage.QueryPredicate<? extends Entity>> LAST_ENTITY_QUERY_PREDICATEA previously executed entity query predicate. -
ENTITY_SORT_PREDICATE
public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> ENTITY_SORT_PREDICATEA predicate that defines the sort order of entities -
SKIP_NEXT_CHANGE_LOGGING
A flag that will skip the automatic change logging of an entity the next time it is stored withEntityManager.storeEntity(Entity, Entity, boolean)
. The flag will automatically be removed after the entity has been stored so that it must always be set before an entity is stored to skip the creation of history. -
NO_ENTITY_LOCKING
A flag that prevents the locking of an entity byEntityManager
if it is set on the entity. This is intended to be used for bulk processing of entities. Applying code must ensure that the flag is removed afterwards, especially for cached entities. If necessary it must also ensure that the affected entities are not modified concurrently while the locking is disabled (e.g. throughEntityManager.setEntityModificationLock(String, Predicate)
). -
DISPLAY_ENTITY_IDS
A flag to display entity references in annotated entities as IDs instead of describing strings. -
ENTITY_ATTRIBUTES
public static final org.obrel.core.RelationType<List<de.esoco.lib.expression.Function<? super Entity,?>>> ENTITY_ATTRIBUTESA property that contains a list of entity attribute access functions. These can either be attribute relation types (because relation types implement the function interface) or more complex functions that access the entity hierarchy or convert values (for example). This type is not defined with the standard factory method for list properties to avoid the creation of a default value. Accessing a non-existing relation of this type will therefore return NULL. -
ENTITY_DISPLAY_MODE
The mode to be used when displaying entity attributes. The default value isEntityDefinition.DisplayMode.COMPACT
-
HIERARCHICAL_QUERY_MODE
public static final org.obrel.core.RelationType<EntityRelationTypes.HierarchicalQueryMode> HIERARCHICAL_QUERY_MODEA relation type to set theEntityRelationTypes.HierarchicalQueryMode
on a query predicate. The default value isEntityRelationTypes.HierarchicalQueryMode.NEVER
. -
HIERARCHY_ROOT_PREDICATE
public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> HIERARCHY_ROOT_PREDICATEA predicate that defines the roots of a hierarchy. It constrains the root entities that are displayed in the hierarchical query modesALWAYS
andUNCONSTRAINED
. If not set the default root criterion PARENT = NULL will be used. -
HIERARCHY_CHILD_PREDICATE
public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> HIERARCHY_CHILD_PREDICATEA predicate that defines the children in a hierarchy. It constrains the child entities that are displayed in the hierarchical query modesALWAYS
andUNCONSTRAINED
. If not set all children in the hierarchy will be displayed. -
ENTITY_STORE_ORIGIN
Will contain the entity that caused the storing of an entity during an invocation ofEntityManager.storeEntity(Entity, Entity)
. -
DEPENDENT_STORE_ENTITIES
A collection of entities that should be stored if the target entity is stored. Evaluated byEntityManager.storeEntity(Entity, Entity)
to store the dependent entities in the order in which they are listed after the main entity. After the dependent entities have been stored this relation will be removed from the target. -
REMOVED_CHILDREN
A mapping from global entity IDs to child entities that have been removed from a parent. Used internally by the change tracking of the framework. -
DISPLAY_PROPERTIES
public static final org.obrel.core.RelationType<de.esoco.lib.property.MutableProperties> DISPLAY_PROPERTIESRefers to a set of properties that can be used as a parameter annotation to define display properties for the rendering in user interfaces. -
ENTITY_MODIFICATION_HANDLE
A string identifier that is set on entities to detect concurrent modifications of entities. -
CONTEXT_UPDATED_ENTITIES
The set of modified entities that have been successfully updated within an entity modification context but may need to be reset if the enclosing transaction failed. -
CONTEXT_MODIFIED_ENTITIES
A mapping from global entity IDs to entities that have been modified within an entity modification context. -
ENTITY_ID
The default attribute for an auto-incremented long integer entity ID. This attribute will be added automatically to all entities that do not have a specific ID attribute. Only used internally by the package. Applications should always query the actual ID attribute from the entity definition with the methodEntityDefinition.getIdAttribute()
. -
TARGET
An entity that is targeted by another entity for a certain purpose. -
LAST_CHANGE
The date of the last modification of an entity. -
MODIFICATION_LOCK
A flag indicating that an entity is locked for (typically concurrent) modifications. Related application code must be aware of this flag and prevent modifications if it is set. -
HIDE_ENTITY
Entity is hidden from display. -
ENTITY_TAGS
A set of tags that categorize an entity. -
REMOVED_CHILD_ENTITIES
Child entities that have bee removed from a parent.
-
-
Methodendetails
-
arbitraryEntityAttribute
public static org.obrel.core.RelationType<Entity> arbitraryEntityAttribute(org.obrel.core.RelationTypeModifier... flags) A factory method to create a new relation type for entity attributes that reference arbitrary entity instances. The storage datatype for such attributes will be a string that holds the global entity ID.- Siehe auch:
-
autoIdAttribute
public static org.obrel.core.RelationType<Integer> autoIdAttribute(org.obrel.core.RelationTypeModifier... flags) Factory method that creates an integer relation type for automatically generated object identifiers. The flagsMetaTypes.AUTOGENERATED
andMetaTypes.OBJECT_ID_ATTRIBUTE
will be set on the returned type. The initial value of relations with this type will be zero.- Siehe auch:
-
childAttribute
public static <T extends Entity> org.obrel.core.RelationType<List<T>> childAttribute(org.obrel.core.RelationTypeModifier... flags) A factory method that creates a new relation type for relations to a list of child entities. To prevent initialization cycles the child entity definition cannot be set directly through this method. Instead, a special constructor ofEntityDefinition
must be used to define the child entity relation and set the entity definitions on the attributes.- Parameter:
flags
- The optional type flags- Gibt zurück:
- A new relation type instance
- Siehe auch:
-
entityAttribute
public static <T extends Entity> org.obrel.core.RelationType<T> entityAttribute(org.obrel.core.RelationTypeModifier... flags) A factory method to create a new relation type for entity attributes that reference an entity instance of a specific entity subclass.- Parameter:
flags
- The optional type flags- Gibt zurück:
- A new relation type instance
- Siehe auch:
-
idAttribute
public static org.obrel.core.RelationType<Integer> idAttribute(org.obrel.core.RelationTypeModifier... flags) A factory method that creates an integer relation type for object identifiers. The flagMetaTypes.OBJECT_ID_ATTRIBUTE
will be set on the returned type. The initial value of relations with this type will be zero.- Siehe auch:
-
longAutoIdAttribute
public static org.obrel.core.RelationType<Long> longAutoIdAttribute(org.obrel.core.RelationTypeModifier... flags) Factory method that creates a long relation type for automatically generated object identifiers. The flagsMetaTypes.AUTOGENERATED
andMetaTypes.OBJECT_ID_ATTRIBUTE
will be set on the returned type. The initial value of relations with this type will be zero.- Siehe auch:
-
longIdAttribute
public static org.obrel.core.RelationType<Long> longIdAttribute(org.obrel.core.RelationTypeModifier... flags) A factory method that creates a long relation type for object identifiers. The flagMetaTypes.OBJECT_ID_ATTRIBUTE
will be set on the returned type. The initial value of relations with this type will be zero.- Siehe auch:
-
parentAttribute
public static <T extends Entity> org.obrel.core.RelationType<T> parentAttribute(org.obrel.core.RelationTypeModifier... flags) A factory method that creates a new relation type for relations to the parent entity in a hierarchy. To prevent initialization cycles the entity definition of the parent attribute cannot be set directly in this method. Instead this will be handled by theEntityDefinition
class.- Parameter:
flags
- The optional type flags- Gibt zurück:
- A new relation type instance
- Siehe auch:
-
rootAttribute
public static <T extends Entity> org.obrel.core.RelationType<T> rootAttribute(org.obrel.core.RelationTypeModifier... flags) Creates a new relation type for the root entity in a hierarchy similar toparentAttribute(RelationTypeModifier...)
.- Siehe auch:
-
setAttributeDisplayFlag
public static void setAttributeDisplayFlag(de.esoco.lib.property.PropertyName<Boolean> property, org.obrel.core.RelationType<?>... attributes) Convenience method to set a boolean display property.- Siehe auch:
-
setAttributeDisplayProperty
public static void setAttributeDisplayProperty(int value, de.esoco.lib.property.PropertyName<Integer> property, org.obrel.core.RelationType<?>... attributes) Convenience method to set an integer display property.- Siehe auch:
-
setAttributeDisplayProperty
public static <T> void setAttributeDisplayProperty(de.esoco.lib.property.PropertyName<T> property, T value, org.obrel.core.RelationType<?>... attributes) Helper method for subclasses to set a display property on attributes. If the attribute doesn't have display attributes yet they will be created and stored in theDISPLAY_PROPERTIES
relation.ATTENTION: this setting affects all occurrences of the given attribute. Properties of attributes that are re-used in different contexts (e.g. relation types defined in
StandardTypes
or similar) should be set with aEntityDefinition.ATTRIBUTE_DISPLAY_PROPERTIES_FIELD
instead to prevent side effects.- Parameter:
property
- The property to setvalue
- The property valuesattributes
- The attributes to set the display property on
-