-
public interface EntityType
Defines an Entity type and serves as a Factory forAttribute
instances associated with this entity type. A factory forEntityType
instances.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Attribute<T>
attribute(String name, Class<T> valueClass)
Creates a newAttribute
, associated with this EntityType.Attribute<BigDecimal>
bigDecimalAttribute(String name)
Creates a new BigDecimal based attribute, associated with this EntityType.Attribute<Boolean>
booleanAttribute(String name)
Creates a new Boolean based attribute, associated with this EntityType.Attribute<byte[]>
byteArrayAttribute(String name)
Creates a newAttribute
, associated with this EntityType.Attribute<Character>
characterAttribute(String name)
Creates a new Character based attribute, associated with this EntityType.ConditionType
conditionType(String name)
Instantiates a newConditionType
for this entity typeString
domainName()
Attribute<Double>
doubleAttribute(String name)
Creates a new Double based attribute, associated with this EntityType.Attribute<Entity>
entityAttribute(String name)
Creates a newAttribute
, associated with this EntityType.<T extends Entity>
Class<T>entityClass()
static <T extends Entity>
EntityTypeentityType(String name, String domainName, Class<T> entityClass)
Creates a new EntityType instance.static <T extends Entity>
EntityTypeentityType(String name, String domainName, Class<T> entityClass, String resourceBundleName)
Creates a new EntityType instance.static EntityType
entityType(String name, String domainName, String resourceBundleName)
Creates a new EntityType instance.<A> ForeignKey
foreignKey(String name, Attribute<A> attribute, Attribute<A> referencedAttribute)
Creates a newForeignKey
based on the given attributes.<A,B>
ForeignKeyforeignKey(String name, Attribute<A> firstAttribute, Attribute<A> firstReferencedAttribute, Attribute<B> secondAttribute, Attribute<B> secondReferencedAttribute)
Creates a newForeignKey
based on the given attributes.<A,B,C>
ForeignKeyforeignKey(String name, Attribute<A> firstAttribute, Attribute<A> firstReferencedAttribute, Attribute<B> secondAttribute, Attribute<B> secondReferencedAttribute, Attribute<C> thirdAttribute, Attribute<C> thirdReferencedAttribute)
Creates a newForeignKey
based on the given attributes.ForeignKey
foreignKey(String name, List<ForeignKey.Reference<?>> references)
Creates a newForeignKey
based on the given references.Attribute<Integer>
integerAttribute(String name)
Creates a new Integer based attribute, associated with this EntityType.Attribute<LocalDate>
localDateAttribute(String name)
Creates a new LocalDate based attribute, associated with this EntityType.Attribute<LocalDateTime>
localDateTimeAttribute(String name)
Creates a new LocalDateTime based attribute, associated with this EntityType.Attribute<LocalTime>
localTimeAttribute(String name)
Creates a new LocalTime based attribute, associated with this EntityType.Attribute<Long>
longAttribute(String name)
Creates a new Long based attribute, associated with this EntityType.String
name()
Attribute<OffsetDateTime>
offsetDateTimeAttribute(String name)
Creates a new OffsetDateTime based attribute, associated with this EntityType.String
resourceBundleName()
Attribute<Short>
shortAttribute(String name)
Creates a new Short based attribute, associated with this EntityType.Attribute<String>
stringAttribute(String name)
Creates a new String based attribute, associated with this EntityType.
-
-
-
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 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
-
attribute
<T> Attribute<T> attribute(String name, Class<T> valueClass)
Creates a newAttribute
, associated with this EntityType.- Type Parameters:
T
- the attribute type- Parameters:
name
- the attribute namevalueClass
- 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 newAttribute
, associated with this EntityType.- Parameters:
name
- the attribute name- Returns:
- a new
Attribute
-
byteArrayAttribute
Attribute<byte[]> byteArrayAttribute(String name)
Creates a newAttribute
, 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 newForeignKey
based on the given attributes.- Type Parameters:
A
- the attribute type- Parameters:
name
- the attribute nameattribute
- the attributereferencedAttribute
- 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 newForeignKey
based on the given attributes.- Type Parameters:
A
- the first attribute typeB
- the second attribute type- Parameters:
name
- the attribute namefirstAttribute
- the first attributefirstReferencedAttribute
- the first referenced attributesecondAttribute
- the second attributesecondReferencedAttribute
- 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 newForeignKey
based on the given attributes.- Type Parameters:
A
- the first attribute typeB
- the second attribute typeC
- the third attribute type- Parameters:
name
- the attribute namefirstAttribute
- the first attributefirstReferencedAttribute
- the first referenced attributesecondAttribute
- the second attributesecondReferencedAttribute
- the third referenced attributethirdAttribute
- the second attributethirdReferencedAttribute
- the third referenced attribute- Returns:
- a new
ForeignKey
-
foreignKey
ForeignKey foreignKey(String name, List<ForeignKey.Reference<?>> references)
Creates a newForeignKey
based on the given references.- Parameters:
name
- the attribute namereferences
- the references- Returns:
- a new
ForeignKey
- See Also:
ForeignKey.reference(Attribute, Attribute)
-
conditionType
ConditionType conditionType(String name)
Instantiates a newConditionType
for this entity type- Parameters:
name
- the name- Returns:
- a new condition type
-
entityType
static <T extends Entity> EntityType 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 namedomainName
- the name of the domain to associate this entity type withentityClass
- 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 namedomainName
- the name of the domain to associate this entity type withresourceBundleName
- 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, String domainName, Class<T> entityClass, String resourceBundleName)
Creates a new EntityType instance.- Type Parameters:
T
- the entity representation type- Parameters:
name
- the entity type namedomainName
- the name of the domain to associate this entity type withentityClass
- the entity representation classresourceBundleName
- the name of a resource bundle to use for captions, if any- Returns:
- a
EntityType
instance with the given name
-
-