E
- The type of the container class (the entity)T
- The type of the embeddable objectpublic class EmbeddedProperty<E,T> extends Property<E,T>
Embeddable
s.Constructor and Description |
---|
EmbeddedProperty(EntityClass<?> entityClass,
AttributeAccessor attribute)
Instantiates a new embedded property.
|
Modifier and Type | Method and Description |
---|---|
void |
addInsertExpression(E entity,
InsertStatement statement)
Adds an expression according to the current value of the property for the given entity to an SQL insert
statement.
|
List<EntityStatement> |
createPostInsertStatements(E entity)
Creates additional SQL statements that are necessary after this property is written (e.g. for mapping tables) .
|
List<EntityStatement> |
createPreInsertStatements(E entity)
Creates SQL statements that are necessary before this property is written (e.g. for updating the table
generator).
|
Collection<?> |
findReferencedEntities(E entity)
Finds all entities in the current property, that are referenced.
|
String |
getPredicate(E entity)
Creates an SQL predicate that references all entities that have the same value as the given entity.
|
boolean |
isRequired()
Indicates if this property is an required field in the database (needs to exist when the insert statement is
written).
|
boolean |
isTableColumn()
Indicates that this property maps to a column from the parent table.
|
failIfRequired, generatePendingStatements, getExpression, getName, getValue, setValue, toString
public EmbeddedProperty(EntityClass<?> entityClass, AttributeAccessor attribute)
entityClass
- the class of the entityattribute
- the attribute that contains the embedded objectpublic void addInsertExpression(E entity, InsertStatement statement)
Property
addInsertExpression
in class Property<E,T>
entity
- the inspected entitystatement
- the created statementpublic List<EntityStatement> createPostInsertStatements(E entity)
Property
createPostInsertStatements
in class Property<E,T>
entity
- the inspected entitypublic List<EntityStatement> createPreInsertStatements(E entity)
Property
createPreInsertStatements
in class Property<E,T>
entity
- the inspected entitypublic Collection<?> findReferencedEntities(E entity)
Property
findReferencedEntities
in class Property<E,T>
entity
- the inspected entitypublic String getPredicate(E entity)
Property
getPredicate
in class Property<E,T>
entity
- the entitynull
if no such expression is availablepublic boolean isRequired()
Property
isRequired
in class Property<E,T>
true
if the field is requiredpublic boolean isTableColumn()
Property
isTableColumn
in class Property<E,T>
true
if Property.addInsertExpression(Object, InsertStatement)
will add the corresponding value to
the given statementCopyright © 2016 fastnate.org. All rights reserved.