Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metamodel

public Class MapAttributeImpl<X, K, V>

extends PluralAttributeImpl<X, Map<K, V>, V>
implements MapAttribute<X, K, V>
Class Inheritance
All Implemented Interfaces
jakarta.persistence.metamodel.MapAttribute, jakarta.persistence.metamodel.PluralAttribute, jakarta.persistence.metamodel.Bindable, jakarta.persistence.metamodel.Attribute
Type Parameters
<X>
The type the represented Map belongs to
<K>
The type of the key of the represented Map
<V>
The type of the value of the represented Map
Imports
java.util.Map, jakarta.persistence.metamodel.MapAttribute, .Type, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.queries.ContainerPolicy, .MappedKeyMapContainerPolicy, org.eclipse.persistence.mappings.CollectionMapping, .DatabaseMapping, org.eclipse.persistence.mappings.foundation.MapKeyMapping

Purpose: Provides the implementation for the MapAttribute interface of the JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API)

Description: Instances of the type MapAttribute represent persistent Map-valued attributes.

Since
EclipseLink 1.2 - JPA 2.0
See Also
jakarta.persistence.metamodel.MapAttribute

Field Summary

Modifier and TypeField and Description
private Type<K>
keyType

The key type that this Map type is based on

private static final long
serialVersionUID

Item 54: DI 89: explicit UID will avoid performance hit runtime generation of one

Constructor Summary

AccessConstructor and Description
protected
MapAttributeImpl(ManagedTypeImpl<X> managedType, CollectionMapping mapping)

INTERNAL:

protected
MapAttributeImpl(ManagedTypeImpl<X>
- the owning type (EmbeddableTypes do not support mappings)
managedType
,
CollectionMapping
- contains the mapping policy
mapping
,
boolean
- report errors in the metamodel
validationEnabled
)

INTERNAL: Create a new MapAttribute instance.

Method Summary

Modifier and TypeMethod and Description
public PluralAttribute.CollectionType
public Class<T>

Returns:

Java type
getJavaType
()

Implements abstract org.eclipse.persistence.internal.jpa.metamodel.AttributeImpl.getJavaType.

Implements jakarta.persistence.metamodel.Attribute.getJavaType.

Return the Java type of the represented attribute.
public Class<K>

Returns:

Java key type
getKeyJavaType
()

Implements jakarta.persistence.metamodel.MapAttribute.getKeyJavaType.

Return the Java type of the map key.
public Type<K>

Returns:

type representing key type
getKeyType
()

Implements jakarta.persistence.metamodel.MapAttribute.getKeyType.

Return the type representing the key type of the map.
private Class<?>
getOwningPKTypeWhenMapKeyAnnotationMissingOrDefaulted(MappedKeyMapContainerPolicy policy)

INTERNAL: Default to the PK of the owning descriptor when no MapKey or MapKey:name attribute is specified.

Inherited from org.eclipse.persistence.internal.jpa.metamodel.PluralAttributeImpl:
getBindableJavaTypegetBindableTypegetCollectionMappinggetElementTypeisPluraltoString

Field Detail

keyTypeback to summary
private Type<K> keyType

The key type that this Map type is based on

serialVersionUIDback to summary
private static final long serialVersionUID

Item 54: DI 89: explicit UID will avoid performance hit runtime generation of one

Constructor Detail

MapAttributeImplback to summary
protected MapAttributeImpl(ManagedTypeImpl<X> managedType, CollectionMapping mapping)

INTERNAL:

MapAttributeImplback to summary
protected MapAttributeImpl(ManagedTypeImpl<X> managedType, CollectionMapping mapping, boolean validationEnabled)

INTERNAL: Create a new MapAttribute instance. The elementType field is instantiated in the superclass. The keyType field is instantiated in this constructor by using one of the following A) MapContainerPolicy by consulting the keyField or PK class B) MappedKeyMapContainerPolicy by using the mapKeyTargetType on the keyMapping or the attributeClassification on the attributeAccessor

Parameters
managedType:ManagedTypeImpl<X>

- the owning type (EmbeddableTypes do not support mappings)

mapping:CollectionMapping

- contains the mapping policy

validationEnabled:boolean

- report errors in the metamodel

Method Detail

getCollectionTypeback to summary
public PluralAttribute.CollectionType getCollectionType()

Implements abstract org.eclipse.persistence.internal.jpa.metamodel.PluralAttributeImpl.getCollectionType.

Implements jakarta.persistence.metamodel.PluralAttribute.getCollectionType.

Return the collection type.

Returns:PluralAttribute.CollectionType

collection type

Annotations
@Override
getJavaTypeback to summary
public Class<T> getJavaType()

Implements abstract org.eclipse.persistence.internal.jpa.metamodel.AttributeImpl.getJavaType.

Implements jakarta.persistence.metamodel.Attribute.getJavaType.

Return the Java type of the represented attribute.

Returns:Class<T>

Java type

Annotations
@Override
@SuppressWarnings:rawtypes
getKeyJavaTypeback to summary
public Class<K> getKeyJavaType()

Implements jakarta.persistence.metamodel.MapAttribute.getKeyJavaType.

Return the Java type of the map key.

Returns:Class<K>

Java key type

Annotations
@Override
See Also
MapAttribute
getKeyTypeback to summary
public Type<K> getKeyType()

Implements jakarta.persistence.metamodel.MapAttribute.getKeyType.

Return the type representing the key type of the map.

Returns:Type<K>

type representing key type

Annotations
@Override
See Also
MapAttribute
getOwningPKTypeWhenMapKeyAnnotationMissingOrDefaultedback to summary
private Class<?> getOwningPKTypeWhenMapKeyAnnotationMissingOrDefaulted(MappedKeyMapContainerPolicy policy)

INTERNAL: Default to the PK of the owning descriptor when no MapKey or MapKey:name attribute is specified. Prerequisites: policy on the mapping is of type MappedKeyMapPolicy