E - The described classpublic class EntityClass<E> extends Object
entity class.| Modifier and Type | Method and Description |
|---|---|
void |
createPostInsertStatements(E entity,
StatementsWriter writer)
Marks an entity as written and creates any pending update / insert statements.
|
AccessStyle |
getAccessStyle()
The type of access that is used for the properties (field access or bean property access).
|
List<Property<? super E,?>> |
getAdditionalProperties()
Properties of this entity, excluding the
idProperty or properties from joinedParentClass. |
List<Property<? super E,?>> |
getAllProperties()
All properties of this entity, including
idProperty and properties from joinedParentClass. |
List<List<SingularProperty<E,?>>> |
getAllUniqueProperties()
All available sets of properties that make up an additional unique identifier for the entities.
|
Map<String,javax.persistence.AssociationOverride> |
getAssociationOverrides()
All association overriddes of this class and the parent classes.
|
Map<String,javax.persistence.AttributeOverride> |
getAttributeOverrides()
All attribute overriddes of this class and the parent classes.
|
GeneratorContext |
getContext()
The current context.
|
ColumnExpression |
getDiscriminator()
The SQL expression that is used for the disciminator column of this class.
|
GeneratorColumn |
getDiscriminatorColumn()
The column for
discriminator. |
Class<E> |
getEntityClass()
The represented class.
|
String |
getEntityName()
The entity name.
|
ColumnExpression |
getEntityReference(E entity,
String idField,
boolean whereExpression)
Creates an expression that references the id of an entity of this class.
|
Map<Object,GenerationState> |
getEntityStates()
The states of written entities.
|
EntityClass<? super E> |
getHierarchyRoot()
The description of the entity class that is the root of the current inheritance hierarchy.
|
Property<? super E,?> |
getIdProperty()
The property that contains the id for the entity.
|
javax.persistence.InheritanceType |
getInheritanceType()
The inheritance type of this class.
|
EntityClass<? super E> |
getJoinedParentClass()
The description of the next entity class that has
InheritanceType.JOINED, if any. |
Class<? super E> |
getParentEntityClass()
Only used during
build() to find the joinedParentClass even if that one references our class. |
GeneratorColumn |
getPrimaryKeyJoinColumn()
The column that contains the id of this entity if
joinedParentClass is not null. |
Map<String,Property<? super E,?>> |
getProperties()
Mapping from the name of all persistent properties to their description.
|
GeneratorTable |
getTable()
The main table of the entity.
|
List<SingularProperty<E,?>> |
getUniqueProperties()
The properties that make up an additional unique identifier for the entity.
|
UniquePropertyQuality |
getUniquePropertiesQuality()
Indicates the quality of
uniqueProperties. |
boolean |
isNew(E entity)
Indicates that the given entity needs to be written.
|
void |
markExistingEntity(E entity)
Marks a entity reference, where we don't know the ID in the database.
|
<V> void |
markPendingUpdates(E pendingEntity,
V entityToUpdate,
Property<V,?> propertyToUpdate,
Object... arguments)
Marks an update that is necessary when an entity is written (in the future).
|
E |
newInstance()
Creates a new entity of the represented
class. |
void |
onPropertiesAvailable(Consumer<EntityClass<E>> listener)
Registers a listener that is called as soon as all properties of this class are built.
|
String |
toString() |
public void createPostInsertStatements(E entity, StatementsWriter writer) throws IOException
entity - the entity that exists now in the databasewriter - the target of the new statementsIOException - if the writer throws onepublic ColumnExpression getEntityReference(E entity, String idField, boolean whereExpression)
entity - the entityidField - the field that contains the id, only interesting if the id is an EmbeddedPropertywhereExpression - indicates that the reference is used in a "where" statementunique properties or the
id of the entitypublic boolean isNew(E entity)
entity - the entity to checktrue if the entity was neither written, nor exists in the databasepublic void markExistingEntity(E entity)
entity - the entity to markpublic <V> void markPendingUpdates(E pendingEntity, V entityToUpdate, Property<V,?> propertyToUpdate, Object... arguments)
pendingEntity - the entity that needs to be written, before the update can take placeentityToUpdate - the entity to updatepropertyToUpdate - the property of the entity to updatearguments - additional argumentspublic E newInstance()
class.public void onPropertiesAvailable(Consumer<EntityClass<E>> listener)
listener - called as soon as all properties are available@Generated(value="lombok") public GeneratorContext getContext()
@Nonnull @Generated(value="lombok") public Class<E> getEntityClass()
@Nonnull @Generated(value="lombok") public String getEntityName()
@Nonnull @Generated(value="lombok") public GeneratorTable getTable()
@Generated(value="lombok") public AccessStyle getAccessStyle()
@Generated(value="lombok") public javax.persistence.InheritanceType getInheritanceType()
null if no subclass is known and no inhertance is indicated (using one of the inheritance annotations).@Generated(value="lombok") public Class<? super E> getParentEntityClass()
build() to find the joinedParentClass even if that one references our class.@Generated(value="lombok") public EntityClass<? super E> getJoinedParentClass()
InheritanceType.JOINED, if any.@Generated(value="lombok") public EntityClass<? super E> getHierarchyRoot()
@Generated(value="lombok") public ColumnExpression getDiscriminator()
null if no discriminator is used@Generated(value="lombok") public GeneratorColumn getDiscriminatorColumn()
discriminator.
null if this class does not belong to a table that contains a discriminator column@Generated(value="lombok") public GeneratorColumn getPrimaryKeyJoinColumn()
joinedParentClass is not null.@Nullable @Generated(value="lombok") public Property<? super E,?> getIdProperty()
joinedParentClass exists, this property is the id property of the parent class.@Nullable @Generated(value="lombok") public List<SingularProperty<E,?>> getUniqueProperties()
GeneratorContext.getUniquePropertyQuality() and
GeneratorContext.getMaxUniqueProperties() this might be null, even if there is a set of
available unique properties, if the quality is not enough.@Generated(value="lombok") public UniquePropertyQuality getUniquePropertiesQuality()
uniqueProperties.@Generated(value="lombok") public List<List<SingularProperty<E,?>>> getAllUniqueProperties()
@Generated(value="lombok") public Map<String,Property<? super E,?>> getProperties()
@Generated(value="lombok") public List<Property<? super E,?>> getAllProperties()
idProperty and properties from joinedParentClass.@Generated(value="lombok") public List<Property<? super E,?>> getAdditionalProperties()
idProperty or properties from joinedParentClass.@Generated(value="lombok") public Map<Object,GenerationState> getEntityStates()
@Generated(value="lombok") public Map<String,javax.persistence.AttributeOverride> getAttributeOverrides()
@Generated(value="lombok") public Map<String,javax.persistence.AssociationOverride> getAssociationOverrides()
Copyright © 2020 fastnate.org. All rights reserved.