JavaScript is disabled on your browser.
public interface EntityDefinition
Specifies an entity definition.
Nested Class Summary
Nested Classes
static interface
Holds the attribute definitions for an entity type
static interface
Builds a EntityDefinition
static interface
Holds the column definitions for an entity type
static interface
Holds the foreign key definitions for an entity type
static interface
Holds the primary key definition for an entity type
Field Summary
Fields
Specifies whether optimistic locking should be enabled by default for entities
Value type: Boolean
Default value: true
Method Summary
All Methods Instance Methods Abstract Methods
boolean
Creates a new
Entity
instance based on this definition
Creates a new
Entity
instance based on this definition
Creates a new
Entity
instance based on this definition
The default exists predicate returns true if the entity has a non-null original primary key,
which is a best guess about an entity existing in a database.
boolean
Creates a new
Entity.Key
instance based on this definition, initialised with the given value
boolean
boolean
Field Details
OPTIMISTIC_LOCKING
Specifies whether optimistic locking should be enabled by default for entities
Value type: Boolean
Default value: true
Method Details
entityType
Returns:
the entity type
tableName
Returns:
the name of the underlying table, with schema prefix if applicable
condition
Parameters:
conditionType
- the condition type
Returns:
the condition provider associated with the given type
Throws:
IllegalArgumentException
- in case no ConditionProvider is associated with the given conditionType
See Also:
validator
Returns:
the validator for this entity type
exists
The default exists predicate returns true if the entity has a non-null original primary key,
which is a best guess about an entity existing in a database.
Returns:
the predicate to use to check if an entity of this type exists in the database
caption
Returns:
the caption to use when presenting entities of this type
description
Returns:
the entity description
smallDataset
boolean smallDataset ()
Returns:
true if the underlying table is small enough for displaying the contents in a combo box
readOnly
boolean readOnly ()
Returns:
true if this entity type is read only
optimisticLocking
boolean optimisticLocking ()
Returns:
true if optimistic locking should be used during updates
orderBy
Returns:
the default order by clause to use when querying entities of this type, an empty Optional if none is available
selectTableName
Returns:
the name of the table to use when selecting entities of this type
selectQuery
Returns:
the select query to use when selecting entities of this type, an empty Optional if none is available
stringFactory
Returns:
the function responsible for providing toString values for this entity type
cacheToString
boolean cacheToString ()
Returns:
true if the result of toString() is cached
comparator
Returns:
the comparator used when comparing this entity type to other entities
entity
Creates a new
Entity
instance based on this definition
Returns:
a new Entity
instance
entity
Creates a new
Entity
instance based on this definition
Parameters:
values
- the values
Returns:
a new Entity
instance
Throws:
IllegalArgumentException
- in case any of the value attributes are not part of the entity.
entity
Creates a new
Entity
instance based on this definition
Parameters:
values
- the values
originalValues
- the original values
Returns:
a new Entity
instance
Throws:
IllegalArgumentException
- in case any of the value attributes are not part of the entity.
primaryKey
Creates a new
Entity.Key
instance based on this definition, initialised with the given value
Type Parameters:
T
- the key value type
Parameters:
value
- the key value, assuming a single value key
Returns:
a new Entity.Key
instance
Throws:
IllegalStateException
- in case the given primary key is a composite key
IllegalArgumentException
- in case the value is not of the correct type