Class DynamicTypeImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.dynamic.DynamicTypeImpl
-
- All Implemented Interfaces:
Cloneable
,DynamicType
public class DynamicTypeImpl extends Object implements DynamicType, Cloneable
An EntityType provides a metadata facade into the EclipseLink object-relational metadata (descriptors & mappings) with specific knowledge of the entity types being dynamic.- Since:
- EclipseLink 1.2
- Author:
- dclarke, mnorman
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassDescriptor
descriptor
protected DynamicPropertiesManager
dpm
protected Set<DatabaseMapping>
mappingsRequiringInitialization
These properties require initialization when a new instance is created.protected DynamicType
parentType
-
Fields inherited from interface org.eclipse.persistence.dynamic.DynamicType
DESCRIPTOR_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DynamicTypeImpl()
DynamicTypeImpl(ClassDescriptor descriptor, DynamicType parentType)
Creation of an EntityTypeImpl for an existing Descriptor with mappings.
-
Method Summary
-
-
-
Field Detail
-
descriptor
protected ClassDescriptor descriptor
-
parentType
protected DynamicType parentType
-
dpm
protected DynamicPropertiesManager dpm
-
mappingsRequiringInitialization
protected Set<DatabaseMapping> mappingsRequiringInitialization
These properties require initialization when a new instance is created. This includes properties that are primitives as well as relationships requiring indirection ValueHolders or collections.
-
-
Constructor Detail
-
DynamicTypeImpl
protected DynamicTypeImpl()
-
DynamicTypeImpl
public DynamicTypeImpl(ClassDescriptor descriptor, DynamicType parentType)
Creation of an EntityTypeImpl for an existing Descriptor with mappings.- Parameters:
descriptor
-
-
-
Method Detail
-
getDescriptor
public ClassDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDynamicType
- Returns:
- the underlying
ClassDescriptor
for the mapped type
-
setDescriptor
public void setDescriptor(ClassDescriptor descriptor)
-
getDynamicPropertiesManager
public DynamicPropertiesManager getDynamicPropertiesManager()
-
setDynamicPropertiesManager
public void setDynamicPropertiesManager(DynamicPropertiesManager dpm)
-
getParentType
public DynamicType getParentType()
- Specified by:
getParentType
in interfaceDynamicType
- Returns:
- The parent type or null if this type does not have a persistent superclass
-
getMappings
public List<DatabaseMapping> getMappings()
-
getName
public String getName()
Description copied from interface:DynamicType
Return the entity type's name. This is the short name of the class or theClassDescriptor.getAlias()
- Specified by:
getName
in interfaceDynamicType
- See Also:
DynamicType.getName()
-
getClassName
public String getClassName()
- Specified by:
getClassName
in interfaceDynamicType
- Returns:
- Fully qualified name of mapped class.
-
getNumberOfProperties
public int getNumberOfProperties()
Description copied from interface:DynamicType
The current number of properties.Note: Some implementations support adding mapped attributes at runtime so it is best to avoid caching the result.
- Specified by:
getNumberOfProperties
in interfaceDynamicType
-
getMappingsRequiringInitialization
public Set<DatabaseMapping> getMappingsRequiringInitialization()
-
isInitialized
public boolean isInitialized()
-
containsProperty
public boolean containsProperty(String propertyName)
- Specified by:
containsProperty
in interfaceDynamicType
-
getJavaClass
public Class<? extends DynamicEntity> getJavaClass()
- Specified by:
getJavaClass
in interfaceDynamicType
-
getMapping
public DatabaseMapping getMapping(String propertyName)
-
getPropertiesNames
public List<String> getPropertiesNames()
Description copied from interface:DynamicType
The current names of properties.Note: Some implementations support adding mapped attributes at runtime so it is best to avoid caching the result.
- Specified by:
getPropertiesNames
in interfaceDynamicType
-
getPropertyType
public Class<?> getPropertyType(String propertyName)
- Specified by:
getPropertyType
in interfaceDynamicType
-
newDynamicEntity
public DynamicEntity newDynamicEntity()
- Specified by:
newDynamicEntity
in interfaceDynamicType
-
checkSet
public void checkSet(String propertyName, Object value) throws DynamicException
Ensure the value being set is supported by the mapping. If the mapping is direct/basic and the mapping's type is primitive ensure the non-primitive type is allowed.- Throws:
DynamicException
-
getPropertyIndex
public int getPropertyIndex(String propertyName)
- Specified by:
getPropertyIndex
in interfaceDynamicType
-
getPropertyType
public Class<?> getPropertyType(int propertyIndex)
- Specified by:
getPropertyType
in interfaceDynamicType
-
-