Purpose: Provides the implementation for the ManagedType interface of the JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API)
Description: Instances of the type ManagedType represent entities, mapped superclasses and embeddable types.
jakarta.persistence.metamodel.ManagedType
| Modifier and Type | Field and Description |
|---|---|
| protected ClassDescriptor | descriptor
Native RelationalDescriptor that contains all the mappings of this type |
| private Map | members
The map of attributes keyed on attribute string name |
| protected MetamodelImpl | metamodel
Reference to the metamodel that this managed type belongs to |
| Access | Constructor and Description |
|---|---|
| protected | ManagedTypeImpl(MetamodelImpl
- the metamodel that this managedType is associated with metamodel, ClassDescriptor - the RelationalDescriptor that defines this managedType descriptor)INTERNAL: This constructor will create a ManagedType but will not initialize its member mappings. |
| Modifier and Type | Method and Description |
|---|---|
| protected static ManagedTypeImpl | create(MetamodelImpl metamodel, ClassDescriptor descriptor)
INTERNAL: Return an instance of a ManagedType based on the RelationalDescriptor parameter |
| public Attribute | Returns: attribute with given namethe name of the represented attribute name)Implements jakarta. |
| public Set | getAttributes()
Implements jakarta. |
| public CollectionAttribute | Returns: CollectionAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <E> CollectionAttribute | Returns: CollectionAttribute of the given name and element typethe name of the represented attribute name, Class<E> the element type of the represented
attribute elementType)Implements jakarta. |
| protected Attribute | Returns: attribute with given namethe name of the represented attribute name, boolean true if we already know the attribute exists on the leaf attributeKnownToExistOnLeafTarget)INTERNAL: Return the declared attribute of the managed type that corresponds to the specified name. |
| public Attribute | Returns: attribute with given namethe name of the represented attribute name)Implements jakarta. |
| public Set | getDeclaredAttributes()
Implements jakarta. |
| public CollectionAttribute | Returns: declared CollectionAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <E> CollectionAttribute | Returns: declared CollectionAttribute of the given name and element typethe name of the represented attribute name, Class<E> the element type of the represented
attribute elementType)Implements jakarta. |
| public <E> ListAttribute | Returns: declared ListAttribute of the given name and element typethe name of the represented attribute name, Class<E> the element type of the represented
attribute elementType)Implements jakarta. |
| public ListAttribute | Returns: declared ListAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public MapAttribute | Returns: MapAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <K, V> MapAttribute | Returns: MapAttribute of the given name and key and value typesthe name of the represented attribute name, Class<K> the key type of the represented attribute keyType, Class<V> the value type of the represented attribute valueType)Implements jakarta. |
| public Set | Returns: declared collection valued attributesImplements jakarta. |
| public SetAttribute | Returns: declared SetAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <E> SetAttribute | Returns: declared SetAttribute of the given name and element typethe name of the represented attribute name, Class<E> the element type of the represented
attribute elementType)Implements jakarta. |
| public SingularAttribute | Returns: declared single-valued attribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <Y> SingularAttribute | Returns: declared single-valued attribute of the given name and typethe name of the represented attribute name, Class<Y> the type of the represented attribute type)Implements jakarta. |
| public Set | Returns: declared single-valued attributesImplements jakarta. |
| public ClassDescriptor | |
| public ListAttribute | Returns: ListAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| private ListAttribute | |
| public <E> ListAttribute | Returns: ListAttribute of the given name and element typethe name of the represented attribute name, Class<E> the element type of the represented
attribute elementType)Implements jakarta. |
| private ManagedTypeImpl | Returns: ManagedType supertype or null if no superclassINTERNAL: Return the ManagedType that represents the superType (superclass) of the current ManagedType. |
| public MapAttribute | Returns: MapAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <K, V> MapAttribute | Returns: MapAttribute of the given name and key and value typesthe name of the represented attribute name, Class<K> the key type of the represented attribute keyType, Class<V> the value type of the represented attribute valueType)Implements jakarta. |
| protected Map | |
| protected MetamodelImpl | |
| public Set | Returns: collection valued attributesImplements jakarta. |
| public SetAttribute | Returns: SetAttribute of the given namethe name of the represented attribute name)Implements jakarta. |
| public <E> SetAttribute | Returns: SetAttribute of the given name and element typethe name of the represented attribute name, Class<E> the element type of the represented
attribute elementType)Implements jakarta. |
| public SingularAttribute | Returns: single-valued attribute with the given namethe name of the represented attribute name)Implements jakarta. |
| public <Y> SingularAttribute | Returns: single-valued attribute with given name and typethe name of the represented attribute name, Class<Y> the type of the represented attribute type)Implements jakarta. |
| public Set | Returns: single-valued attributesImplements jakarta. |
| protected Class | getTypeClassFromAttributeOrMethodLevelAccessor(DatabaseMapping mapping)
INTERNAL: Get the elementType directly from the class using a reflective method call directly on the containing java class associated with this managedType. |
| protected void | initialize()
INTERNAL: Initialize the members of this ManagedType based on the mappings defined on the descriptor. |
| private AttributeImpl | initializePluralAttributeTypeNotFound(ManagedTypeImpl<X> managedType, CollectionMapping collectionMapping, boolean validation)
INTERNAL: Handle the case where we were unable to determine the element type of the plural attribute. |
| private boolean | Returns: true if the attribute is declared at this first level, false if no attribute is found in the superTree, or false if the attribute is found declared higher up in the inheritance superTree- String name of possible declared attribute search attributeName)INTERNAL: Recursively search the superclass tree of the current managedType for the named attribute. |
| private boolean | Returns: true if the attribute is declared at this first level, false if no attribute is found in the superTree, or false if the attribute is found declared higher up in the inheritance superTree- String name of possible declared attribute search attributeName, Attribute<X, Y> firstLevelAttribute)INTERNAL: Recursively search the superclass tree of the current managedType for the named attribute. |
| private boolean | isAutoboxedType(Class<?>
(the type we are verifying against) targetPrimitiveOrWrapperClass, Class<?> (the type that may be the autoboxed or primitive equal actualPrimitiveOrWrapperClass)INTERNAL: This function returns whether the Object class passed in can be autoboxed (a primitive wrapped in its' object type) or the reverse - an autoboxed object that wraps a primitive type). |
| protected boolean | isIdentifiableType()
Implements abstract org. |
| protected boolean | isManagedType()
Implements abstract org. |
| protected void | toStringHelper(StringBuffer aBuffer)
Implements abstract org. |
| private void | verifyAttributeTypeAndReturnType(Attribute<X, Y>
- the Attribute we are verifying anAttribute, Class<?> - the java element or basic element type attributeElementType, PluralAttribute.- the plural return type aReturnCollectionTypeINTERNAL: Perform type checking on the attribute and return types of the named attribute. |