public abstract class DefaultEntities extends Object implements Entities, Serializable
Entities
implementation.Modifier | Constructor and Description |
---|---|
protected |
DefaultEntities(DomainType domainType)
Instantiates a new DefaultEntities for the given domainType
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(EntityDefinition definition) |
Entity.Builder |
builder(EntityType entityType)
Creates a new
Entity.Builder instance. |
boolean |
contains(EntityType entityType) |
EntityDefinition |
definition(EntityType entityType)
Returns the
EntityDefinition for the given entityType |
EntityDefinition |
definition(String entityTypeName)
Returns the
EntityDefinition for the given entityType name |
Collection<EntityDefinition> |
definitions()
Returns all
EntityDefinition s available |
DomainType |
domainType() |
Entity |
entity(EntityType entityType)
Creates a new
Entity instance with the given entityType |
Key.Builder |
keyBuilder(EntityType entityType)
Creates a new
Key.Builder instance for the given entity type. |
<T> Key |
primaryKey(EntityType entityType,
T value)
Creates a new
Key instance with the given entityType, initialised with the given value |
<T> List<Key> |
primaryKeys(EntityType entityType,
T... values)
Creates new
Key instances with the given entityType, initialised with the given values |
protected void |
setStrictForeignKeys(boolean strictForeignKeys) |
protected DefaultEntities(DomainType domainType)
domainType
- the domainTypepublic final DomainType domainType()
domainType
in interface Entities
DomainType
this Entities
instance is associated withpublic final EntityDefinition definition(EntityType entityType)
Entities
EntityDefinition
for the given entityTypedefinition
in interface Entities
entityType
- the entityTypepublic final EntityDefinition definition(String entityTypeName)
Entities
EntityDefinition
for the given entityType namedefinition
in interface Entities
entityTypeName
- the name of the entityTypepublic final boolean contains(EntityType entityType)
public final Collection<EntityDefinition> definitions()
Entities
EntityDefinition
s availabledefinitions
in interface Entities
public final Entity entity(EntityType entityType)
Entities
Entity
instance with the given entityTypepublic final Entity.Builder builder(EntityType entityType)
Entities
Entity.Builder
instance.builder
in interface Entities
entityType
- the entityTypeEntity.Builder
public final <T> Key primaryKey(EntityType entityType, T value)
Entities
Key
instance with the given entityType, initialised with the given valueprimaryKey
in interface Entities
T
- the key value typeentityType
- the entityTypevalue
- the key value, assumes a single long keyKey
instancepublic final <T> List<Key> primaryKeys(EntityType entityType, T... values)
Entities
Key
instances with the given entityType, initialised with the given valuesprimaryKeys
in interface Entities
T
- the key value typeentityType
- the entityTypevalues
- the key values, assumes a single integer keyKey
instancespublic final Key.Builder keyBuilder(EntityType entityType)
Entities
Key.Builder
instance for the given entity type.keyBuilder
in interface Entities
entityType
- the entity typeprotected final void setStrictForeignKeys(boolean strictForeignKeys)
protected final void add(EntityDefinition definition)