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 Summary
Modifier and TypeMethodDescription<T> Attribute<T>attribute(String name, TypeReference<T> typeReference) Creates a newAttribute, associated with this EntityType.<T> Attribute<T>Creates a newAttribute, associated with this EntityType.bigDecimalAttribute(String name) Creates a new BigDecimal based attribute, associated with this EntityType.bigDecimalColumn(String name) Creates a new BigDecimal based column, associated with this EntityType.booleanAttribute(String name) Creates a new Boolean based attribute, associated with this EntityType.booleanColumn(String name) Creates a new Boolean based column, associated with this EntityType.Attribute<byte[]>byteArrayAttribute(String name) Creates a newAttribute, associated with this EntityType.Column<byte[]>byteArrayColumn(String name) Creates a newColumn, associated with this EntityType.characterAttribute(String name) Creates a new Character based attribute, associated with this EntityType.characterColumn(String name) Creates a new Character based column, associated with this EntityType.<T> Column<T>column(String name, TypeReference<T> typeReference) Creates a newColumn, associated with this EntityType.<T> Column<T>Creates a newColumn, associated with this EntityType.conditionType(String name) Instantiates a newConditionTypefor this entity typedefine(AttributeDefinition.Builder<?, ?>... definitionBuilders) Creates aEntityDefinition.Builderinstance based on the given attribute definition builders.define(List<AttributeDefinition.Builder<?, ?>> definitionBuilders) Creates aEntityDefinition.Builderinstance based on the given attribute definition builders.doubleAttribute(String name) Creates a new Double based attribute, associated with this EntityType.doubleColumn(String name) Creates a new Double based column, associated with this EntityType.entityAttribute(String name) Creates a newAttribute, associated with this EntityType.static EntityTypeentityType(String name, DomainType domainType, String resourceBundleName) Creates a new EntityType instance.<A> ForeignKeyforeignKey(String name, Column<A> column, Column<A> referencedColumn) Creates a newForeignKeybased on the given attributes.<A,B> ForeignKey foreignKey(String name, Column<A> firstColumn, Column<A> firstReferencedColumn, Column<B> secondColumn, Column<B> secondReferencedColumn) Creates a newForeignKeybased on the given columns.<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 newForeignKeybased on the given columns.foreignKey(String name, List<ForeignKey.Reference<?>> references) Creates a newForeignKeybased on the given references.integerAttribute(String name) Creates a new Integer based attribute, associated with this EntityType.integerColumn(String name) Creates a new Integer based column, associated with this EntityType.localDateAttribute(String name) Creates a new LocalDate based attribute, associated with this EntityType.localDateColumn(String name) Creates a new LocalDate based column, associated with this EntityType.localDateTimeAttribute(String name) Creates a new LocalDateTime based attribute, associated with this EntityType.localDateTimeColumn(String name) Creates a new LocalDateTime based column, associated with this EntityType.localTimeAttribute(String name) Creates a new LocalTime based attribute, associated with this EntityType.localTimeColumn(String name) Creates a new LocalTime based column, associated with this EntityType.longAttribute(String name) Creates a new Long based attribute, associated with this EntityType.longColumn(String name) Creates a new Long based column, associated with this EntityType.name()Creates a new OffsetDateTime based attribute, associated with this EntityType.offsetDateTimeColumn(String name) Creates a new OffsetDateTime based column, associated with this EntityType.shortAttribute(String name) Creates a new Short based attribute, associated with this EntityType.shortColumn(String name) Creates a new Short based column, associated with this EntityType.stringAttribute(String name) Creates a new String based attribute, associated with this EntityType.stringColumn(String name) Creates a new String based column, associated with this EntityType.
-
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.
-
resourceBundleName
String resourceBundleName()- Returns:
- the name of the resource bundle, containing captions for this entity type, if any
-
define
Creates aEntityDefinition.Builderinstance based on the given attribute definition builders.- Parameters:
definitionBuilders- builders for the attribute definitions comprising the entity- Returns:
- a
EntityDefinition.Builderinstance - Throws:
IllegalArgumentException- in casedefinitionBuildersis emptyIllegalArgumentException- in case of a entityType mismatch
-
define
Creates aEntityDefinition.Builderinstance based on the given attribute definition builders.- Parameters:
definitionBuilders- builders for the attribute definitions comprising the entity- Returns:
- a
EntityDefinition.Builderinstance - Throws:
IllegalArgumentException- in casedefinitionBuildersis emptyIllegalArgumentException- in case of a entityType mismatch
-
attribute
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
-
attribute
Creates a newAttribute, associated with this EntityType.- Type Parameters:
T- the column type- Parameters:
name- the attribute nametypeReference- theTypeReferencerepresenting the attribute value type- Returns:
- a new
Column
-
longAttribute
Creates a new Long based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new Long based attribute.
-
integerAttribute
Creates a new Integer based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new Integer based attribute.
-
shortAttribute
Creates a new Short based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new Short based attribute.
-
doubleAttribute
Creates a new Double based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new Double based attribute.
-
bigDecimalAttribute
Creates a new BigDecimal based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new BigDecimal based attribute.
-
localDateAttribute
Creates a new LocalDate based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new LocalDate based attribute.
-
localTimeAttribute
Creates a new LocalTime based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new LocalTime based attribute.
-
localDateTimeAttribute
Creates a new LocalDateTime based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new LocalDateTime based attribute.
-
offsetDateTimeAttribute
Creates a new OffsetDateTime based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new OffsetDateTime based attribute.
-
stringAttribute
Creates a new String based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new String based attribute.
-
characterAttribute
Creates a new Character based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new Character based attribute.
-
booleanAttribute
Creates a new Boolean based attribute, associated with this EntityType.- Parameters:
name- the attribute name.- Returns:
- a new Boolean based attribute.
-
entityAttribute
Creates a newAttribute, associated with this EntityType.- Parameters:
name- the attribute name- Returns:
- a new
Attribute
-
byteArrayAttribute
Creates a newAttribute, associated with this EntityType.- Parameters:
name- the attribute name- Returns:
- a new
Attribute
-
column
Creates a newColumn, associated with this EntityType.- Type Parameters:
T- the column type- Parameters:
name- the column namevalueClass- the class representing the column value type- Returns:
- a new
Column
-
column
Creates a newColumn, associated with this EntityType.- Type Parameters:
T- the column type- Parameters:
name- the column nametypeReference- theTypeReferencerepresenting the column value type- Returns:
- a new
Column
-
longColumn
Creates a new Long based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new Long based column.
-
integerColumn
Creates a new Integer based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new Integer based column.
-
shortColumn
Creates a new Short based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new Short based column.
-
doubleColumn
Creates a new Double based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new Double based column.
-
bigDecimalColumn
Creates a new BigDecimal based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new BigDecimal based column.
-
localDateColumn
Creates a new LocalDate based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new LocalDate based column.
-
localTimeColumn
Creates a new LocalTime based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new LocalTime based column.
-
localDateTimeColumn
Creates a new LocalDateTime based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new LocalDateTime based column.
-
offsetDateTimeColumn
Creates a new OffsetDateTime based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new OffsetDateTime based column.
-
stringColumn
Creates a new String based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new String based column.
-
characterColumn
Creates a new Character based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new Character based column.
-
booleanColumn
Creates a new Boolean based column, associated with this EntityType.- Parameters:
name- the column name.- Returns:
- a new Boolean based column.
-
byteArrayColumn
Creates a newColumn, associated with this EntityType.- Parameters:
name- the column name- Returns:
- a new
Column
-
foreignKey
Creates a newForeignKeybased on the given attributes.- Type Parameters:
A- the attribute type- Parameters:
name- the attribute namecolumn- the columnreferencedColumn- 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 newForeignKeybased on the given columns.- Type Parameters:
A- the first column typeB- the second column type- Parameters:
name- the column namefirstColumn- the first columnfirstReferencedColumn- the first referenced columnsecondColumn- the second columnsecondReferencedColumn- the second referenced column- Returns:
- a new
ForeignKey
-
foreignKey
<A,B, ForeignKey foreignKeyC> (String name, Column<A> firstColumn, Column<A> firstReferencedColumn, Column<B> secondColumn, Column<B> secondReferencedColumn, Column<C> thirdColumn, Column<C> thirdReferencedColumn) Creates a newForeignKeybased on the given columns.- Type Parameters:
A- the first column typeB- the second column typeC- the third column type- Parameters:
name- the column namefirstColumn- the first columnfirstReferencedColumn- the first referenced columnsecondColumn- the second columnsecondReferencedColumn- the third referenced columnthirdColumn- the second columnthirdReferencedColumn- the third referenced column- Returns:
- a new
ForeignKey
-
foreignKey
Creates a newForeignKeybased on the given references.- Parameters:
name- the attribute namereferences- the references- Returns:
- a new
ForeignKey - See Also:
-
conditionType
Instantiates a newConditionTypefor this entity type- Parameters:
name- the name- Returns:
- a new condition type
-
entityType
Creates a new EntityType instance.- Parameters:
name- the entity type namedomainType- the domainType to associate this entity type withresourceBundleName- the name of a resource bundle to use for captions, if any- Returns:
- a
EntityTypeinstance with the given name
-