Klasse EntityRelationTypes

java.lang.Object
de.esoco.entity.EntityRelationTypes

@RelationTypeNamespace("de.esoco.entity") public class EntityRelationTypes extends Object
Contains entity-specific relation type declarations and factory methods to create such relation types.
  • Verschachtelte Klassen - Übersicht

    Verschachtelte Klassen
    Modifizierer und Typ
    Klasse
    Beschreibung
    static enum 
    Enumeration of the possible modes for hierarchical queries.
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final org.obrel.core.RelationType<Boolean>
    A flag that indicates that an entity has been placed in the entity cache of EntityManager.
    static final org.obrel.core.RelationType<Map<String,Entity>>
    A mapping from global entity IDs to entities that have been modified within an entity modification context.
    static final org.obrel.core.RelationType<Set<Entity>>
    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.
    static final org.obrel.core.RelationType<List<Entity>>
    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,
    static final org.obrel.core.RelationType<List<de.esoco.lib.expression.Function<? super Entity,?>>>
    A property that contains a list of entity attribute access functions.
    static final org.obrel.core.RelationType<Class<? extends Entity>>
    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 entities
    static final org.obrel.core.RelationType<Entity>
    Will contain the entity that caused the storing of an entity during an invocation of EntityManager.storeEntity(Entity, Entity).
    static final org.obrel.core.RelationType<Set<String>>
    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 the EntityRelationTypes.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 by EntityManager if it is set on the entity.
    static final org.obrel.core.RelationType<Long>
    The entity ID of an entity's parent entity.
    static final org.obrel.core.RelationType<List<Entity>>
    Child entities that have bee removed from a parent.
    static final org.obrel.core.RelationType<List<Entity>>
    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 hierarchy
    static final org.obrel.core.RelationType<Boolean>
    A flag that will skip the automatic change logging of an entity the next time it is stored with EntityManager.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 Typ
    Methode
    Beschreibung
    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.
    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.
    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.
    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 to parentAttribute(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.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • ROOT_ATTRIBUTE

      public static final org.obrel.core.RelationType<Boolean> ROOT_ATTRIBUTE
      Meta-type that marks a relation type that represents the root in a hierarchy
    • CACHE_ENTITY

      public static final org.obrel.core.RelationType<Boolean> CACHE_ENTITY
      A flag that indicates that an entity has been placed in the entity cache of EntityManager.
    • PARENT_ENTITY_ID

      public static final org.obrel.core.RelationType<Long> PARENT_ENTITY_ID
      The entity ID of an entity's parent entity.
    • MASTER_ENTITY_ID

      public static final org.obrel.core.RelationType<Long> MASTER_ENTITY_ID
      The entity ID of an entity's master entity.
    • ENTITY

      public static final org.obrel.core.RelationType<Entity> ENTITY
      A generic reference to a single entity,
    • ENTITY_CLASS

      public static final org.obrel.core.RelationType<Class<? extends Entity>> ENTITY_CLASS
      An entity class.
    • ENTITY_PREDICATE

      public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> ENTITY_PREDICATE
      A predicate for entities.
    • ENTITY_QUERY_PREDICATE

      public static final org.obrel.core.RelationType<de.esoco.storage.QueryPredicate<? extends Entity>> ENTITY_QUERY_PREDICATE
      A 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_PREDICATE
      A previously executed entity query predicate.
    • ENTITY_SORT_PREDICATE

      public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> ENTITY_SORT_PREDICATE
      A predicate that defines the sort order of entities
    • SKIP_NEXT_CHANGE_LOGGING

      public static final org.obrel.core.RelationType<Boolean> SKIP_NEXT_CHANGE_LOGGING
      A flag that will skip the automatic change logging of an entity the next time it is stored with EntityManager.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

      public static final org.obrel.core.RelationType<Boolean> NO_ENTITY_LOCKING
      A flag that prevents the locking of an entity by EntityManager 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. through EntityManager.setEntityModificationLock(String, Predicate)).
    • DISPLAY_ENTITY_IDS

      public static final org.obrel.core.RelationType<Boolean> 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_ATTRIBUTES
      A 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

      public static final org.obrel.core.RelationType<EntityDefinition.DisplayMode> ENTITY_DISPLAY_MODE
      The mode to be used when displaying entity attributes. The default value is EntityDefinition.DisplayMode.COMPACT
    • HIERARCHICAL_QUERY_MODE

      public static final org.obrel.core.RelationType<EntityRelationTypes.HierarchicalQueryMode> HIERARCHICAL_QUERY_MODE
      A relation type to set the EntityRelationTypes.HierarchicalQueryMode on a query predicate. The default value is EntityRelationTypes.HierarchicalQueryMode.NEVER.
    • HIERARCHY_ROOT_PREDICATE

      public static final org.obrel.core.RelationType<de.esoco.lib.expression.Predicate<? super Entity>> HIERARCHY_ROOT_PREDICATE
      A predicate that defines the roots of a hierarchy. It constrains the root entities that are displayed in the hierarchical query modes ALWAYS and UNCONSTRAINED. 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_PREDICATE
      A predicate that defines the children in a hierarchy. It constrains the child entities that are displayed in the hierarchical query modes ALWAYS and UNCONSTRAINED. If not set all children in the hierarchy will be displayed.
    • ENTITY_STORE_ORIGIN

      public static final org.obrel.core.RelationType<Entity> ENTITY_STORE_ORIGIN
      Will contain the entity that caused the storing of an entity during an invocation of EntityManager.storeEntity(Entity, Entity).
    • DEPENDENT_STORE_ENTITIES

      public static final org.obrel.core.RelationType<List<Entity>> DEPENDENT_STORE_ENTITIES
      A collection of entities that should be stored if the target entity is stored. Evaluated by EntityManager.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

      public static final org.obrel.core.RelationType<List<Entity>> 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_PROPERTIES
      Refers 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

      public static final org.obrel.core.RelationType<String> ENTITY_MODIFICATION_HANDLE
      A string identifier that is set on entities to detect concurrent modifications of entities.
    • CONTEXT_UPDATED_ENTITIES

      public static final org.obrel.core.RelationType<Set<Entity>> 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

      public static final org.obrel.core.RelationType<Map<String,Entity>> CONTEXT_MODIFIED_ENTITIES
      A mapping from global entity IDs to entities that have been modified within an entity modification context.
    • ENTITY_ID

      public static final org.obrel.core.RelationType<Long> 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 method EntityDefinition.getIdAttribute().
    • TARGET

      public static final org.obrel.core.RelationType<Entity> TARGET
      An entity that is targeted by another entity for a certain purpose.
    • LAST_CHANGE

      public static final org.obrel.core.RelationType<Date> LAST_CHANGE
      The date of the last modification of an entity.
    • MODIFICATION_LOCK

      public static final org.obrel.core.RelationType<Boolean> 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

      public static final org.obrel.core.RelationType<Boolean> HIDE_ENTITY
      Entity is hidden from display.
    • ENTITY_TAGS

      public static final org.obrel.core.RelationType<Set<String>> ENTITY_TAGS
      A set of tags that categorize an entity.
    • REMOVED_CHILD_ENTITIES

      public static final org.obrel.core.RelationType<List<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 flags MetaTypes.AUTOGENERATED and MetaTypes.OBJECT_ID_ATTRIBUTE will be set on the returned type. The initial value of relations with this type will be zero.
      Siehe auch:
      • RelationTypes.newRelationType(String, Class, RelationTypeModifier...)
    • 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 of EntityDefinition 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:
      • RelationTypes.newListType(String, Class, RelationTypeModifier...)
    • 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:
      • RelationTypes.newRelationType(String, Class, RelationTypeModifier...)
    • 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 flag MetaTypes.OBJECT_ID_ATTRIBUTE will be set on the returned type. The initial value of relations with this type will be zero.
      Siehe auch:
      • RelationTypes.newRelationType(String, Class, RelationTypeModifier...)
    • 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 flags MetaTypes.AUTOGENERATED and MetaTypes.OBJECT_ID_ATTRIBUTE will be set on the returned type. The initial value of relations with this type will be zero.
      Siehe auch:
      • RelationTypes.newRelationType(String, Class, RelationTypeModifier...)
    • 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 flag MetaTypes.OBJECT_ID_ATTRIBUTE will be set on the returned type. The initial value of relations with this type will be zero.
      Siehe auch:
      • RelationTypes.newRelationType(String, Class, RelationTypeModifier...)
    • 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 the EntityDefinition class.
      Parameter:
      flags - The optional type flags
      Gibt zurück:
      A new relation type instance
      Siehe auch:
      • RelationTypes.newRelationType(String, Class, RelationTypeModifier...)
    • 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 to parentAttribute(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 the DISPLAY_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 a EntityDefinition.ATTRIBUTE_DISPLAY_PROPERTIES_FIELD instead to prevent side effects.

      Parameter:
      property - The property to set
      value - The property values
      attributes - The attributes to set the display property on