Interface MapAttribute<X,K,V>
- Type Parameters:
X
- The type of the declaring entity viewK
- The type of the key of the represented MapV
- The type of the value of the represented Map
- All Superinterfaces:
Attribute<X,Map<K,V>>
,PluralAttribute<X,Map<K,V>,V>
- All Known Subinterfaces:
MethodMapAttribute<X,K,V>
,MethodMultiMapAttribute<X,K,V,C>
public interface MapAttribute<X,K,V> extends PluralAttribute<X,Map<K,V>,V>
Instances of the type MapAttribute represent persistent Map-valued attributes.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.blazebit.persistence.view.metamodel.Attribute
Attribute.AttributeType, Attribute.MappingType, Attribute.MemberType
Nested classes/interfaces inherited from interface com.blazebit.persistence.view.metamodel.PluralAttribute
PluralAttribute.CollectionType, PluralAttribute.ElementCollectionType
-
Method Summary
Modifier and Type Method Description String[]
getKeyFetches()
The associations that should be fetched along with the entity mapped by the key of this attribute.Map<ManagedViewType<? extends K>,String>
getKeyInheritanceSubtypeMappings()
Returns the inheritance subtypes that should be considered for the keys of this map attribute.String
getKeyMapping()
Returns the key mapping of the attribute.Type<K>
getKeyType()
Returns the java type of the key.<R extends Map<K, V> & RecordingContainer<? extends Map<K, V>>>
MapInstantiator<Map<K,V>,R>getMapInstantiator()
Returns the map instantiator for this attribute.boolean
isKeySubview()
Returns true if the key of this map attribute is a subview, otherwise false.void
renderKeyMapping(String parent, ServiceProvider serviceProvider, StringBuilder sb)
Renders the key mapping for the given parent expression to the given string builder.Methods inherited from interface com.blazebit.persistence.view.metamodel.Attribute
getAttributeType, getBatchSize, getConvertedJavaType, getDeclaringType, getFetches, getFetchStrategy, getJavaType, getLimitExpression, getMappingType, getMemberType, getOffsetExpression, getOrderByItems, isCollection, isCorrelated, isSubquery, isSubview
Methods inherited from interface com.blazebit.persistence.view.metamodel.PluralAttribute
getCollectionType, getComparator, getComparatorClass, getElementCollectionType, getElementInheritanceSubtypeMappings, getElementType, isForcedUnique, isIndexed, isOrdered, isSorted
-
Method Details
-
getKeyType
Returns the java type of the key.- Returns:
- The java type of the key
-
getKeyInheritanceSubtypeMappings
Map<ManagedViewType<? extends K>,String> getKeyInheritanceSubtypeMappings()Returns the inheritance subtypes that should be considered for the keys of this map attribute. When the key type of the map attribute is not a subview, this returns an empty set.- Returns:
- The inheritance subtypes or an empty set
- Since:
- 1.2.0
-
isKeySubview
boolean isKeySubview()Returns true if the key of this map attribute is a subview, otherwise false.- Returns:
- True if the key of this map attribute is a subview, otherwise false
- Since:
- 1.2.0
-
getMapInstantiator
<R extends Map<K, V> & RecordingContainer<? extends Map<K, V>>> MapInstantiator<Map<K,V>,R> getMapInstantiator()Returns the map instantiator for this attribute.- Type Parameters:
R
- The recording map type- Returns:
- The map instantiator
- Since:
- 1.5.0
-
getKeyMapping
String getKeyMapping()Returns the key mapping of the attribute.- Returns:
- The key mapping of the attribute
- Since:
- 1.5.0
-
getKeyFetches
String[] getKeyFetches()The associations that should be fetched along with the entity mapped by the key of this attribute.- Returns:
- The association that should be fetched
- Since:
- 1.5.0
-
renderKeyMapping
Renders the key mapping for the given parent expression to the given string builder.- Parameters:
parent
- The parent expressionserviceProvider
- The service providersb
- The string builder- Since:
- 1.5.0
-