X - The represented type.public abstract class ManagedTypeImpl<X> extends TypeImpl<X>
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.
javax.persistence.metamodel.ManagedType,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected ClassDescriptor |
descriptor
Native RelationalDescriptor that contains all the mappings of this type
|
protected MetamodelImpl |
metamodel
Reference to the metamodel that this managed type belongs to
|
| Modifier | Constructor and Description |
|---|---|
protected |
ManagedTypeImpl(MetamodelImpl metamodel,
ClassDescriptor 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
|
<any> |
getAttribute(java.lang.String name)
Return the attribute of the managed
type that corresponds to the specified name.
|
java.util.Set<<any>> |
getAttributes()
Return the attributes of the managed type.
|
<any> |
getCollection(java.lang.String name)
Return the Collection-valued attribute of the managed type
that corresponds to the specified name.
|
<E> <any> |
getCollection(java.lang.String name,
java.lang.Class<E> elementType)
Return the Collection-valued attribute of the managed type
that corresponds to the specified name and Java element type.
|
<any> |
getDeclaredAttribute(java.lang.String name)
Return the declared attribute of the managed
type that corresponds to the specified name.
|
protected <any> |
getDeclaredAttribute(java.lang.String name,
boolean attributeKnownToExistOnLeafTarget)
INTERNAL:
Return the declared attribute of the managed
type that corresponds to the specified name.
|
java.util.Set<<any>> |
getDeclaredAttributes()
Return the attributes declared by the managed type.
|
<any> |
getDeclaredCollection(java.lang.String name)
Return the Collection-valued attribute declared by the
managed type that corresponds to the specified name.
|
<E> <any> |
getDeclaredCollection(java.lang.String name,
java.lang.Class<E> elementType)
Return the Collection-valued attribute declared by the
managed type that corresponds to the specified name and Java
element type.
|
<any> |
getDeclaredList(java.lang.String name)
Return the List-valued attribute declared by the managed
type that corresponds to the specified name.
|
<E> <any> |
getDeclaredList(java.lang.String name,
java.lang.Class<E> elementType)
Return the List-valued attribute declared by the managed
type that corresponds to the specified name and Java
element type.
|
<any> |
getDeclaredMap(java.lang.String name)
Return the Map-valued attribute of the managed type that
corresponds to the specified name.
|
<K,V> <any> |
getDeclaredMap(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Return the Map-valued attribute of the managed type that
corresponds to the specified name and Java key and value
types.
|
java.util.Set<<any>> |
getDeclaredPluralAttributes()
Return all collection-valued attributes declared by the
managed type.
|
<any> |
getDeclaredSet(java.lang.String name)
Return the Set-valued attribute declared by the managed type
that corresponds to the specified name.
|
<E> <any> |
getDeclaredSet(java.lang.String name,
java.lang.Class<E> elementType)
Return the Set-valued attribute declared by the managed type
that corresponds to the specified name and Java element type.
|
<any> |
getDeclaredSingularAttribute(java.lang.String name)
Return the declared single-valued attribute of the managed
type that corresponds to the specified name in the
represented type.
|
<Y> <any> |
getDeclaredSingularAttribute(java.lang.String name,
java.lang.Class<Y> type)
Return the declared single-valued attribute of the
managed type that corresponds to the specified name and Java
type in the represented type.
|
java.util.Set<<any>> |
getDeclaredSingularAttributes()
Return the single-valued attributes declared by the managed
type.
|
ClassDescriptor |
getDescriptor()
INTERNAL:
Return the RelationalDescriptor associated with this ManagedType
|
<any> |
getList(java.lang.String name)
Return the List-valued attribute of the managed type that
corresponds to the specified name.
|
<E> <any> |
getList(java.lang.String name,
java.lang.Class<E> elementType)
Return the List-valued attribute of the managed type that
corresponds to the specified name and Java element type.
|
<any> |
getMap(java.lang.String name)
Return the Map-valued attribute of the managed type that
corresponds to the specified name.
|
<K,V> <any> |
getMap(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Return the Map-valued attribute of the managed type that
corresponds to the specified name and Java key and value
types.
|
protected java.util.Map<java.lang.String,<any>> |
getMembers()
INTERNAL:
Return the Map of AttributeImpl members keyed by String.
|
protected MetamodelImpl |
getMetamodel()
INTERNAL:
Return the Metamodel that this ManagedType is associated with.
|
java.util.Set<<any>> |
getPluralAttributes()
Return all collection-valued attributes of the managed type.
|
<any> |
getSet(java.lang.String name)
Return the Set-valued attribute of the managed type that
corresponds to the specified name.
|
<E> <any> |
getSet(java.lang.String name,
java.lang.Class<E> elementType)
Return the Set-valued attribute of the managed type that
corresponds to the specified name and Java element type.
|
<any> |
getSingularAttribute(java.lang.String name)
Return the single-valued attribute of the managed type that
corresponds to the specified name in the represented type.
|
<Y> <any> |
getSingularAttribute(java.lang.String name,
java.lang.Class<Y> type)
Return the single-valued attribute of the managed
type that corresponds to the specified name and Java type
in the represented type.
|
java.util.Set<<any>> |
getSingularAttributes()
Return the single-valued attributes of the managed type.
|
protected java.lang.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.
|
protected boolean |
isIdentifiableType()
INTERNAL:
Return whether this type is identifiable.
|
protected boolean |
isManagedType()
INTERNAL:
Return whether this type is identifiable.
|
protected void |
toStringHelper(java.lang.StringBuffer aBuffer)
INTERNAL:
Append the partial string representation of the receiver to the StringBuffer.
|
getJavaType, getJavaType, getJavaTypeName, isEntity, isMappedSuperclass, toStringprotected ClassDescriptor descriptor
protected MetamodelImpl metamodel
protected ManagedTypeImpl(MetamodelImpl metamodel, ClassDescriptor descriptor)
metamodel - - the metamodel that this managedType is associated withdescriptor - - the RelationalDescriptor that defines this managedTypepublic <any> getAttribute(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic java.util.Set<<any>> getAttributes()
public <any> getCollection(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic <E> <any> getCollection(java.lang.String name,
java.lang.Class<E> elementType)
name - the name of the represented attributeelementType - the element type of the represented
attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not present in the managed typepublic java.util.Set<<any>> getPluralAttributes()
protected <any> getDeclaredAttribute(java.lang.String name,
boolean attributeKnownToExistOnLeafTarget)
name - the name of the represented attributeattributeKnownToExistOnLeafTarget - true if we already know the attribute exists on the leafjava.lang.IllegalArgumentException - if attribute of the given
name is not declared in the managed typepublic <any> getDeclaredAttribute(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not declared in the managed typepublic java.util.Set<<any>> getDeclaredAttributes()
public <any> getDeclaredCollection(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not declared in the managed typepublic <E> <any> getDeclaredCollection(java.lang.String name,
java.lang.Class<E> elementType)
name - the name of the represented attributeelementType - the element type of the represented
attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not declared in the managed typepublic java.util.Set<<any>> getDeclaredPluralAttributes()
protected static ManagedTypeImpl<?> create(MetamodelImpl metamodel, ClassDescriptor descriptor)
metamodel - descriptor - public <E> <any> getDeclaredList(java.lang.String name,
java.lang.Class<E> elementType)
name - the name of the represented attributeelementType - the element type of the represented
attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not declared in the managed typepublic <any> getDeclaredList(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not declared in the managed typepublic <any> getDeclaredMap(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic <K,V> <any> getDeclaredMap(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
name - the name of the represented attributekeyType - the key type of the represented attributevalueType - the value type of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not present in the managed typepublic <any> getDeclaredSet(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not declared in the managed typepublic <E> <any> getDeclaredSet(java.lang.String name,
java.lang.Class<E> elementType)
name - the name of the represented attributeelementType - the element type of the represented
attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not declared in the managed typepublic <any> getDeclaredSingularAttribute(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not declared in the managed typepublic <Y> <any> getDeclaredSingularAttribute(java.lang.String name,
java.lang.Class<Y> type)
name - the name of the represented attributetype - the type of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not declared in the managed typepublic java.util.Set<<any>> getDeclaredSingularAttributes()
public ClassDescriptor getDescriptor()
public <any> getList(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic <E> <any> getList(java.lang.String name,
java.lang.Class<E> elementType)
name - the name of the represented attributeelementType - the element type of the represented
attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not present in the managed typepublic <any> getMap(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic <K,V> <any> getMap(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
name - the name of the represented attributekeyType - the key type of the represented attributevalueType - the value type of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not present in the managed typeprotected java.util.Map<java.lang.String,<any>> getMembers()
protected MetamodelImpl getMetamodel()
public <any> getSet(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic <E> <any> getSet(java.lang.String name,
java.lang.Class<E> elementType)
name - the name of the represented attributeelementType - the element type of the represented
attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not present in the managed typepublic <any> getSingularAttribute(java.lang.String name)
name - the name of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name is not present in the managed typepublic <Y> <any> getSingularAttribute(java.lang.String name,
java.lang.Class<Y> type)
name - the name of the represented attributetype - the type of the represented attributejava.lang.IllegalArgumentException - if attribute of the given
name and type is not present in the managed typepublic java.util.Set<<any>> getSingularAttributes()
protected void initialize()
Initialization should occur after all types in the metamodel have been created already.
protected java.lang.Class getTypeClassFromAttributeOrMethodLevelAccessor(DatabaseMapping mapping)
mapping - protected boolean isIdentifiableType()
isIdentifiableType in class TypeImpl<X>protected boolean isManagedType()
isManagedType in class TypeImpl<X>protected void toStringHelper(java.lang.StringBuffer aBuffer)
toStringHelper in class TypeImpl<X>