E - The type of the container entityK - The type of the key of the mapT - The type of the entity inside of the collectionpublic class MapProperty<E,K,T> extends PluralProperty<E,Map<K,T>,T>
EntityClass that is a Map.| Modifier and Type | Field and Description |
|---|---|
private Class<K> |
keyClass
The class of the key of the map.
|
private GeneratorColumn |
keyColumn
The name of the column that contains the key.
|
private ValueConverter<K> |
keyConverter
The converter for the target value,
null if not a primitive value. |
private EntityClass<K> |
keyEntityClass
The description of the key class,
null if not an entity. |
| Constructor and Description |
|---|
MapProperty(EntityClass<?> sourceClass,
AttributeAccessor attribute,
javax.persistence.AssociationOverride associationOverride,
javax.persistence.AttributeOverride attributeOverride)
Creates a new map property.
|
| Modifier and Type | Method and Description |
|---|---|
private static GeneratorColumn |
buildKeyColumn(GeneratorTable table,
javax.persistence.MapKeyColumn keyColumn,
String defaultKeyColumn) |
private static GeneratorColumn |
buildKeyColumn(GeneratorTable table,
javax.persistence.MapKeyJoinColumn keyColumn,
String defaultKeyColumn) |
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.
|
Class<K> |
getKeyClass()
The class of the key of the map.
|
GeneratorColumn |
getKeyColumn()
The name of the column that contains the key.
|
ValueConverter<K> |
getKeyConverter()
The converter for the target value,
null if not a primitive value. |
EntityClass<K> |
getKeyEntityClass()
The description of the key class,
null if not an entity. |
Map<K,T> |
getValue(E entity)
Resolves the current value for this property on the given entity.
|
(package private) static boolean |
isMapProperty(AttributeAccessor attribute)
Indicates that the given attribute references a map and may be used by an
MapProperty. |
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, newElementcreatePreInsertStatements, failIfRequired, getAttribute, getExpression, getName, getPredicate, getType, isComposition, setValue, toStringprivate final EntityClass<K> keyEntityClass
null if not an entity.private final ValueConverter<K> keyConverter
null if not a primitive value.private final GeneratorColumn keyColumn
public MapProperty(EntityClass<?> sourceClass, AttributeAccessor attribute, javax.persistence.AssociationOverride associationOverride, javax.persistence.AttributeOverride attributeOverride)
sourceClass - the description of the current inspected class that contains this propertyattribute - the accessor of the represented attributeassociationOverride - the configured assocation overrideattributeOverride - the configured attribute override, if we reference an ElementCollectionprivate static GeneratorColumn buildKeyColumn(GeneratorTable table, javax.persistence.MapKeyColumn keyColumn, String defaultKeyColumn)
private static GeneratorColumn buildKeyColumn(GeneratorTable table, javax.persistence.MapKeyJoinColumn keyColumn, String defaultKeyColumn)
static boolean isMapProperty(AttributeAccessor attribute)
MapProperty.attribute - the attribute to checktrue if an MapProperty may be created for the given attributepublic void createPostInsertStatements(StatementsWriter writer, E entity) throws IOException
PropertycreatePostInsertStatements in class Property<E,Map<K,T>>writer - the target of the created statementsentity - the inspected entityIOException - if the writer throws onepublic Collection<?> findReferencedEntities(E entity)
Propertypublic Map<K,T> getValue(E entity)
Property@Generated(value="lombok") public Class<K> getKeyClass()
@Generated(value="lombok") public EntityClass<K> getKeyEntityClass()
null if not an entity.@Generated(value="lombok") public ValueConverter<K> getKeyConverter()
null if not a primitive value.@Generated(value="lombok") public GeneratorColumn getKeyColumn()
getKeyColumn in class PluralProperty<E,Map<K,T>,T>Copyright © 2022 fastnate.org. All rights reserved.