Type Parameters:
T - the attribute type
All Known Subinterfaces:
Column<T>, DerivedAttribute<T>, ForeignKey

public interface Attribute<T>
Typed Attribute. Note that attribute names are case-sensitive and Attributes are equal if their names and entityTypes are equal, the valueClass does not factor into equality.
  • Method Details

    • define

      Returns:
      a Attribute.AttributeDefiner for this attribute
    • type

      Attribute.Type<T> type()
      Returns:
      the attribute type
    • name

      String name()
      Returns:
      the name of this attribute.
    • entityType

      EntityType entityType()
      Returns:
      the entity type this Attribute is associated with
    • attribute

      static <T> Attribute<T> attribute(EntityType entityType, String name, TypeReference<T> typeReference)
      Creates a new Attribute, associated with the given entityType.
      Type Parameters:
      T - the attribute type
      Parameters:
      entityType - the entityType owning this attribute
      name - the attribute name
      typeReference - the TypeReference representing the attribute value type
      Returns:
      a new Attribute
    • attribute

      static <T> Attribute<T> attribute(EntityType entityType, String name, Class<T> valueClass)
      Creates a new Attribute, associated with the given entityType.
      Type Parameters:
      T - the attribute type
      Parameters:
      entityType - the entityType owning this attribute
      name - the attribute name
      valueClass - the class representing the attribute value type
      Returns:
      a new Attribute