E
- The type of the container entityT
- The type of the entity inside of the collectionpublic class CollectionProperty<E,T> extends PluralProperty<E,Collection<T>,T>
EntityClass
that contains more than one value.Modifier and Type | Field and Description |
---|---|
private GeneratorColumn |
orderColumn
The name of the column that saves the order of the entries in the collection.
|
Constructor and Description |
---|
CollectionProperty(EntityClass<?> sourceClass,
AttributeAccessor attribute,
javax.persistence.AssociationOverride associationOverride,
javax.persistence.AttributeOverride attributeOverride)
Creates a new collection property.
|
Modifier and Type | Method and Description |
---|---|
void |
createPostInsertStatements(StatementsWriter writer,
E entity)
Creates additional SQL statements that are necessary after this property is written (e.g. for mapping tables).
|
Collection<?> |
findReferencedEntities(E entity)
Finds all entities in the current property, that are referenced.
|
protected GeneratorColumn |
getKeyColumn()
An optional column that contains the index / key of the values.
|
GeneratorColumn |
getOrderColumn()
The name of the column that saves the order of the entries in the collection.
|
Collection<T> |
getValue(E entity)
Resolves the current value for this property on the given entity.
|
(package private) static boolean |
isCollectionProperty(AttributeAccessor attribute)
Indicates that the given attribute references a collection and may be used by an
CollectionProperty . |
addInsertExpression, buildEmbeddedProperties, buildIdColumn, createDirectValueStatement, createValueExpression, createValueStatement, generatePendingStatements, getAnyMapping, getContext, getDialect, getEmbeddedProperties, getEmbeddedPropertiesByName, getIdColumn, getInverseProperty, getMappedBy, getMappedId, getPropertyArgument, getRequiredEmbeddedProperties, getTable, getValueClass, getValueColumn, getValueConstructor, getValueConverter, getValueEntityClass, hasPluralAnnotation, isComposition, isEmbedded, isEntityReference, isRequired, isTableColumn, isUseTargetTable, newElement
createPreInsertStatements, failIfRequired, getAttribute, getExpression, getName, getPredicate, getType, isComposition, setValue, toString
private final GeneratorColumn orderColumn
public CollectionProperty(EntityClass<?> sourceClass, AttributeAccessor attribute, javax.persistence.AssociationOverride associationOverride, javax.persistence.AttributeOverride attributeOverride)
sourceClass
- the description of the current inspected class that contains this propertyattribute
- accessor to the represented attributeassociationOverride
- the configured assocation overrideattributeOverride
- the configured attribute override, if we reference an ElementCollection
static boolean isCollectionProperty(AttributeAccessor attribute)
CollectionProperty
.attribute
- the attribute to checktrue
if an CollectionProperty
may be created for the given attributepublic void createPostInsertStatements(StatementsWriter writer, E entity) throws IOException
Property
createPostInsertStatements
in class Property<E,Collection<T>>
writer
- the target of the created statementsentity
- the inspected entityIOException
- if the writer throws onepublic Collection<?> findReferencedEntities(E entity)
Property
findReferencedEntities
in class Property<E,Collection<T>>
entity
- the inspected entityprotected GeneratorColumn getKeyColumn()
PluralProperty
getKeyColumn
in class PluralProperty<E,Collection<T>,T>
public Collection<T> getValue(E entity)
Property
getValue
in class Property<E,Collection<T>>
entity
- the entity to inspectnull
if entity is null
@Generated(value="lombok") public GeneratorColumn getOrderColumn()
Copyright © 2022 fastnate.org. All rights reserved.