E - The type of the container entityT - The type of the target entitypublic class EntityProperty<E,T> extends SingularProperty<E,T>
EntityClass that references another entity.| Constructor and Description |
|---|
EntityProperty(GeneratorContext context,
GeneratorTable containerTable,
AttributeAccessor attribute,
javax.persistence.AssociationOverride override)
Creates a new instance of
EntityProperty. |
| Modifier and Type | Method and Description |
|---|---|
void |
addInsertExpression(TableStatement statement,
E entity)
Adds an expression according to the current value of the property for the given entity to an SQL insert
statement.
|
Collection<?> |
findReferencedEntities(E entity)
Finds all entities in the current property, that are referenced.
|
void |
generatePendingStatements(StatementsWriter writer,
E entity,
Object writtenEntity,
Object... arguments)
Generates the update statements for an entity that are required after another entity was generated.
|
AnyMapping<T> |
getAnyMapping()
Contains information about an addition class column, if
Any is used. |
GeneratorColumn |
getColumn()
The name of the join column.
|
GeneratorContext |
getContext()
The current context.
|
ColumnExpression |
getExpression(E entity,
boolean whereExpression)
Creates the expression for the current value of the given entity in SQL.
|
String |
getIdField()
The name of the id for referencing an embedded id.
|
Property<T,?> |
getInverseProperty()
The opposite property of a bidirectional mapping.
|
String |
getMappedBy()
The optional name of a property in the target type, that owns the relationship.
|
String |
getPredicate(E entity)
Creates an SQL predicate that references all entities that have the same value as the given entity.
|
EntityClass<T> |
getTargetClass()
The description of the type of this property.
|
boolean |
isComposition()
Indicates that, according to the
CascadeType, we should remove the target entity when the current entity
is removed. |
boolean |
isRequired()
Indicates, that this property needs a value.
|
boolean |
isTableColumn()
Indicates that this property maps to a column from the parent table.
|
createPostInsertStatements, createPreInsertStatements, failIfRequired, getAttribute, getName, getType, getValue, isComposition, setValue, toStringpublic EntityProperty(GeneratorContext context, GeneratorTable containerTable, AttributeAccessor attribute, @Nullable javax.persistence.AssociationOverride override)
EntityProperty.context - the generator context.containerTable - the table that contains our columnattribute - the accessor of the attributeoverride - optional AttributeOverride configuration.public void addInsertExpression(TableStatement statement, E entity)
PropertyaddInsertExpression in class Property<E,T>statement - the created statemententity - the inspected entitypublic Collection<?> findReferencedEntities(E entity)
PropertyfindReferencedEntities in class Property<E,T>entity - the inspected entitypublic void generatePendingStatements(StatementsWriter writer, E entity, Object writtenEntity, Object... arguments) throws IOException
PropertyEntityClass.markPendingUpdates(E, V, org.fastnate.generator.context.Property<V, ?>, java.lang.Object...) was called before for writtenEntitygeneratePendingStatements in class Property<E,T>writer - the target of the generated statementsentity - the entity that needs to be updatedwrittenEntity - the entity that exists now in the databasearguments - additional arguments that where given to markPendingUpdatesIOException - if the writer throws onepublic ColumnExpression getExpression(E entity, boolean whereExpression)
PropertygetExpression in class Property<E,T>entity - the entitywhereExpression - indicates that the expression is used in a "where" statementnull if no existspublic String getPredicate(E entity)
PropertygetPredicate in class Property<E,T>entity - the entitynull if no such expression is availablepublic boolean isTableColumn()
PropertyisTableColumn in class SingularProperty<E,T>true if Property.addInsertExpression(org.fastnate.generator.statements.TableStatement, E) will add the corresponding value to the given statement@Generated(value="lombok") public GeneratorContext getContext()
@Generated(value="lombok") public EntityClass<T> getTargetClass()
null for attributes defined as type Any.@Generated(value="lombok") public boolean isRequired()
isRequired in class Property<E,T>true if the field is required@Generated(value="lombok") public boolean isComposition()
CascadeType, we should remove the target entity when the current entity
is removed.@Generated(value="lombok") public String getMappedBy()
OneToOne.mappedBy()@Generated(value="lombok") public Property<T,?> getInverseProperty()
@Generated(value="lombok") public GeneratorColumn getColumn()
getColumn in class SingularProperty<E,T>@Generated(value="lombok") public String getIdField()
@Generated(value="lombok") public AnyMapping<T> getAnyMapping()
Any is used.Copyright © 2020 fastnate.org. All rights reserved.