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 Detail

      • domainName

        String domainName()
        Returns:
        the name of the domain this entity type is associated with
      • name

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

        <T extends EntityClass<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
      • 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.
      • byteArrayAttribute

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

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

        <A,​B> ForeignKey foreignKey​(String name,
                                          Attribute<A> firstAttribute,
                                          Attribute<A> firstReferencedAttribute,
                                          Attribute<B> secondAttribute,
                                          Attribute<B> secondReferencedAttribute)
        Creates a new ForeignKey based on the given attributes.
        Type Parameters:
        A - the first attribute type
        B - the second attribute type
        Parameters:
        name - the attribute name
        firstAttribute - the first attribute
        firstReferencedAttribute - the first referenced attribute
        secondAttribute - the second attribute
        secondReferencedAttribute - the second referenced attribute
        Returns:
        a new ForeignKey
      • foreignKey

        <A,​B,​C> ForeignKey foreignKey​(String name,
                                                  Attribute<A> firstAttribute,
                                                  Attribute<A> firstReferencedAttribute,
                                                  Attribute<B> secondAttribute,
                                                  Attribute<B> secondReferencedAttribute,
                                                  Attribute<C> thirdAttribute,
                                                  Attribute<C> thirdReferencedAttribute)
        Creates a new ForeignKey based on the given attributes.
        Type Parameters:
        A - the first attribute type
        B - the second attribute type
        C - the third attribute type
        Parameters:
        name - the attribute name
        firstAttribute - the first attribute
        firstReferencedAttribute - the first referenced attribute
        secondAttribute - the second attribute
        secondReferencedAttribute - the third referenced attribute
        thirdAttribute - the second attribute
        thirdReferencedAttribute - the third referenced attribute
        Returns:
        a new ForeignKey
      • 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 EntityEntityType entityType​(String name,
                                                        String domainName,
                                                        Class<T> entityClass)
        Creates a new EntityType instance.
        Type Parameters:
        T - the entity representation type
        Parameters:
        name - the entity type name
        domainName - the name of the domain 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,
                                     String domainName,
                                     String resourceBundleName)
        Creates a new EntityType instance.
        Parameters:
        name - the entity type name
        domainName - the name of the domain 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 EntityEntityType entityType​(String name,
                                                        String domainName,
                                                        Class<T> entityClass,
                                                        String resourceBundleName)
        Creates a new EntityType instance.
        Type Parameters:
        T - the entity representation type
        Parameters:
        name - the entity type name
        domainName - the name of the domain 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