Interface EntityDefinition.Attributes

Enclosing interface:
EntityDefinition

public static sealed interface EntityDefinition.Attributes
Holds the attribute definitions for an entity type
  • Method Details

    • get

      Returns:
      all attributes for this entity type
    • definitions

      Collection<AttributeDefinition<?>> definitions()
      Returns:
      an unmodifiable view of the attribute definitions
    • derivedFrom

      <T> Collection<Attribute<?>> derivedFrom(Attribute<T> attribute)
      Returns the attributes which values are derived from the value of the given attribute, an empty collection if no such derived attributes exist
      Type Parameters:
      T - the attribute type
      Parameters:
      attribute - the attribute
      Returns:
      a collection containing the attributes which are derived from the given attribute
    • contains

      boolean contains(Attribute<?> attribute)
      Parameters:
      attribute - the attribute
      Returns:
      true if this entity definition contains the given attribute
    • get

      <T> @Nullable Attribute<T> get(String attributeName)
      Returns the attribute with the given name, null if none is found.
      Type Parameters:
      T - the attribute type
      Parameters:
      attributeName - the name of the attribute to fetch
      Returns:
      the attribute with the given name, null if none is found
    • getOrThrow

      <T> Attribute<T> getOrThrow(String attributeName)
      Returns the attribute with the given name.
      Type Parameters:
      T - the attribute type
      Parameters:
      attributeName - the name of the attribute to fetch
      Returns:
      the attribute with the given name
      Throws:
      IllegalArgumentException - in case the attribute was not found
    • selected

      Collection<Attribute<?>> selected()
      Returns the attributes selected by default for this entity type. Contains the selectable columns and foreign keys, excluding lazy loaded columns and foreign keys based on lazy loaded columns.
      Returns:
      the default select attributes
      See Also:
    • definition

      <T> AttributeDefinition<T> definition(Attribute<T> attribute)
      Type Parameters:
      T - the attribute type
      Parameters:
      attribute - the attribute
      Returns:
      the attribute definition associated with attribute.
      Throws:
      IllegalArgumentException - in case no such attribute exists
      NullPointerException - in case attribute is null