Interface EntityType


public interface EntityType
Defines an Entity type and serves as a Factory for Attribute instances associated with this entity type. A factory for EntityType instances.
  • Method Details

    • domainType

      DomainType domainType()
      Returns:
      the domain type this entity type is associated with
    • name

      String name()
      Returns:
      the entity type name, unique within a domain.
    • entityClass

      <T extends Entity> Class<T> entityClass()
      Type Parameters:
      T - the entity class type
      Returns:
      the entity type class
    • resourceBundleName

      String resourceBundleName()
      Returns:
      the name of the resource bundle, containing captions for this entity type, if any
    • define

      EntityDefinition.Builder define(List<AttributeDefinition.Builder<?,?>> definitionBuilders)
      Creates a EntityDefinition.Builder instance based on the given attribute definition builders.
      Parameters:
      definitionBuilders - builders for the attribute definitions comprising the entity
      Returns:
      a EntityDefinition.Builder instance
      Throws:
      IllegalArgumentException - in case definitionBuilders is empty
      IllegalArgumentException - in case of a entityType mismatch
    • define

      EntityDefinition.Builder define(AttributeDefinition.Builder<?,?>... definitionBuilders)
      Creates a EntityDefinition.Builder instance based on the given attribute definition builders.
      Parameters:
      definitionBuilders - builders for the attribute definitions comprising the entity
      Returns:
      a EntityDefinition.Builder instance
      Throws:
      IllegalArgumentException - in case definitionBuilders is empty
      IllegalArgumentException - in case of a entityType mismatch
    • attribute

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

      Attribute<Long> longAttribute(String name)
      Creates a new Long based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new Long based attribute.
    • integerAttribute

      Attribute<Integer> integerAttribute(String name)
      Creates a new Integer based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new Integer based attribute.
    • shortAttribute

      Attribute<Short> shortAttribute(String name)
      Creates a new Short based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new Short based attribute.
    • doubleAttribute

      Attribute<Double> doubleAttribute(String name)
      Creates a new Double based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new Double based attribute.
    • bigDecimalAttribute

      Attribute<BigDecimal> bigDecimalAttribute(String name)
      Creates a new BigDecimal based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new BigDecimal based attribute.
    • localDateAttribute

      Attribute<LocalDate> localDateAttribute(String name)
      Creates a new LocalDate based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new LocalDate based attribute.
    • localTimeAttribute

      Attribute<LocalTime> localTimeAttribute(String name)
      Creates a new LocalTime based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new LocalTime based attribute.
    • localDateTimeAttribute

      Attribute<LocalDateTime> localDateTimeAttribute(String name)
      Creates a new LocalDateTime based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new LocalDateTime based attribute.
    • offsetDateTimeAttribute

      Attribute<OffsetDateTime> offsetDateTimeAttribute(String name)
      Creates a new OffsetDateTime based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new OffsetDateTime based attribute.
    • stringAttribute

      Attribute<String> stringAttribute(String name)
      Creates a new String based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new String based attribute.
    • characterAttribute

      Attribute<Character> characterAttribute(String name)
      Creates a new Character based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new Character based attribute.
    • booleanAttribute

      Attribute<Boolean> booleanAttribute(String name)
      Creates a new Boolean based attribute, associated with this EntityType.
      Parameters:
      name - the attribute name.
      Returns:
      a new Boolean based attribute.
    • entityAttribute

      Attribute<Entity> entityAttribute(String name)
      Creates a new Attribute, associated with this EntityType.
      Parameters:
      name - the attribute name
      Returns:
      a new Attribute
    • byteArrayAttribute

      Attribute<byte[]> byteArrayAttribute(String name)
      Creates a new Attribute, associated with this EntityType.
      Parameters:
      name - the attribute name
      Returns:
      a new Attribute
    • column

      <T> Column<T> column(String name, Class<T> valueClass)
      Creates a new Column, associated with this EntityType.
      Type Parameters:
      T - the column type
      Parameters:
      name - the column name
      valueClass - the class representing the column value type
      Returns:
      a new Column
    • longColumn

      Column<Long> longColumn(String name)
      Creates a new Long based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new Long based column.
    • integerColumn

      Column<Integer> integerColumn(String name)
      Creates a new Integer based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new Integer based column.
    • shortColumn

      Column<Short> shortColumn(String name)
      Creates a new Short based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new Short based column.
    • doubleColumn

      Column<Double> doubleColumn(String name)
      Creates a new Double based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new Double based column.
    • bigDecimalColumn

      Column<BigDecimal> bigDecimalColumn(String name)
      Creates a new BigDecimal based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new BigDecimal based column.
    • localDateColumn

      Column<LocalDate> localDateColumn(String name)
      Creates a new LocalDate based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new LocalDate based column.
    • localTimeColumn

      Column<LocalTime> localTimeColumn(String name)
      Creates a new LocalTime based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new LocalTime based column.
    • localDateTimeColumn

      Column<LocalDateTime> localDateTimeColumn(String name)
      Creates a new LocalDateTime based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new LocalDateTime based column.
    • offsetDateTimeColumn

      Column<OffsetDateTime> offsetDateTimeColumn(String name)
      Creates a new OffsetDateTime based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new OffsetDateTime based column.
    • stringColumn

      Column<String> stringColumn(String name)
      Creates a new String based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new String based column.
    • characterColumn

      Column<Character> characterColumn(String name)
      Creates a new Character based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new Character based column.
    • booleanColumn

      Column<Boolean> booleanColumn(String name)
      Creates a new Boolean based column, associated with this EntityType.
      Parameters:
      name - the column name.
      Returns:
      a new Boolean based column.
    • byteArrayColumn

      Column<byte[]> byteArrayColumn(String name)
      Creates a new Column, associated with this EntityType.
      Parameters:
      name - the column name
      Returns:
      a new Column
    • foreignKey

      <A> ForeignKey foreignKey(String name, Column<A> column, Column<A> referencedColumn)
      Creates a new ForeignKey based on the given attributes.
      Type Parameters:
      A - the attribute type
      Parameters:
      name - the attribute name
      column - the column
      referencedColumn - the referenced column
      Returns:
      a new ForeignKey
    • foreignKey

      <A, B> ForeignKey foreignKey(String name, Column<A> firstColumn, Column<A> firstReferencedColumn, Column<B> secondColumn, Column<B> secondReferencedColumn)
      Creates a new ForeignKey based on the given columns.
      Type Parameters:
      A - the first column type
      B - the second column type
      Parameters:
      name - the column name
      firstColumn - the first column
      firstReferencedColumn - the first referenced column
      secondColumn - the second column
      secondReferencedColumn - the second referenced column
      Returns:
      a new ForeignKey
    • foreignKey

      <A, B, C> ForeignKey foreignKey(String name, Column<A> firstColumn, Column<A> firstReferencedColumn, Column<B> secondColumn, Column<B> secondReferencedColumn, Column<C> thirdColumn, Column<C> thirdReferencedColumn)
      Creates a new ForeignKey based on the given columns.
      Type Parameters:
      A - the first column type
      B - the second column type
      C - the third column type
      Parameters:
      name - the column name
      firstColumn - the first column
      firstReferencedColumn - the first referenced column
      secondColumn - the second column
      secondReferencedColumn - the third referenced column
      thirdColumn - the second column
      thirdReferencedColumn - the third referenced column
      Returns:
      a new ForeignKey
    • foreignKey

      ForeignKey foreignKey(String name, List<ForeignKey.Reference<?>> references)
      Creates a new ForeignKey based on the given references.
      Parameters:
      name - the attribute name
      references - the references
      Returns:
      a new ForeignKey
      See Also:
    • conditionType

      ConditionType conditionType(String name)
      Instantiates a new ConditionType for this entity type
      Parameters:
      name - the name
      Returns:
      a new condition type
    • entityType

      static <T extends Entity> EntityType entityType(String name, DomainType domainType, Class<T> entityClass)
      Creates a new EntityType instance.
      Type Parameters:
      T - the entity representation type
      Parameters:
      name - the entity type name
      domainType - the domainType to associate this entity type with
      entityClass - the entity representation class
      Returns:
      a EntityType instance with the given name
    • entityType

      static EntityType entityType(String name, DomainType domainType, String resourceBundleName)
      Creates a new EntityType instance.
      Parameters:
      name - the entity type name
      domainType - the domainType to associate this entity type with
      resourceBundleName - the name of a resource bundle to use for captions, if any
      Returns:
      a EntityType instance with the given name
    • entityType

      static <T extends Entity> EntityType entityType(String name, DomainType domainType, Class<T> entityClass, String resourceBundleName)
      Creates a new EntityType instance.
      Type Parameters:
      T - the entity representation type
      Parameters:
      name - the entity type name
      domainType - the domainType to associate this entity type with
      entityClass - the entity representation class
      resourceBundleName - the name of a resource bundle to use for captions, if any
      Returns:
      a EntityType instance with the given name