Class DynamicTypeImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.dynamic.DynamicTypeImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,DynamicType
public class DynamicTypeImpl extends java.lang.Object implements DynamicType, java.lang.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 ClassDescriptordescriptorprotected DynamicPropertiesManagerdpmprotected java.util.Set<DatabaseMapping>mappingsRequiringInitializationThese properties require initialization when a new instance is created.protected DynamicTypeparentType-
Fields inherited from interface org.eclipse.persistence.dynamic.DynamicType
DESCRIPTOR_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDynamicTypeImpl()DynamicTypeImpl(ClassDescriptor descriptor, DynamicType parentType)Creation of an EntityTypeImpl for an existing Descriptor with mappings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckSet(java.lang.String propertyName, java.lang.Object value)Ensure the value being set is supported by the mapping.java.lang.Objectclone()booleancontainsProperty(java.lang.String propertyName)java.lang.StringgetClassName()ClassDescriptorgetDescriptor()DynamicPropertiesManagergetDynamicPropertiesManager()java.lang.Class<? extends DynamicEntity>getJavaClass()DatabaseMappinggetMapping(java.lang.String propertyName)java.util.List<DatabaseMapping>getMappings()java.util.Set<DatabaseMapping>getMappingsRequiringInitialization()java.lang.StringgetName()Return the entity type's name.intgetNumberOfProperties()The current number of properties.DynamicTypegetParentType()java.util.List<java.lang.String>getPropertiesNames()The current names of properties.intgetPropertyIndex(java.lang.String propertyName)java.lang.Class<?>getPropertyType(int propertyIndex)java.lang.Class<?>getPropertyType(java.lang.String propertyName)booleanisInitialized()DynamicEntitynewDynamicEntity()voidsetDescriptor(ClassDescriptor descriptor)voidsetDynamicPropertiesManager(DynamicPropertiesManager dpm)java.lang.StringtoString()
-
-
-
Field Detail
-
descriptor
protected ClassDescriptor descriptor
-
parentType
protected DynamicType parentType
-
dpm
protected DynamicPropertiesManager dpm
-
mappingsRequiringInitialization
protected java.util.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
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
getDescriptor
public ClassDescriptor getDescriptor()
- Specified by:
getDescriptorin interfaceDynamicType- Returns:
- the underlying
ClassDescriptorfor 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:
getParentTypein interfaceDynamicType- Returns:
- The parent type or null if this type does not have a persistent superclass
-
getMappings
public java.util.List<DatabaseMapping> getMappings()
-
getName
public java.lang.String getName()
Description copied from interface:DynamicTypeReturn the entity type's name. This is the short name of the class or theClassDescriptor.getAlias()- Specified by:
getNamein interfaceDynamicType- See Also:
DynamicType.getName()
-
getClassName
public java.lang.String getClassName()
- Specified by:
getClassNamein interfaceDynamicType- Returns:
- Fully qualified name of mapped class.
-
getNumberOfProperties
public int getNumberOfProperties()
Description copied from interface:DynamicTypeThe current number of properties.Note: Some implementations support adding mapped attributes at runtime so it is best to avoid caching the result.
- Specified by:
getNumberOfPropertiesin interfaceDynamicType
-
getMappingsRequiringInitialization
public java.util.Set<DatabaseMapping> getMappingsRequiringInitialization()
-
isInitialized
public boolean isInitialized()
-
containsProperty
public boolean containsProperty(java.lang.String propertyName)
- Specified by:
containsPropertyin interfaceDynamicType
-
getJavaClass
public java.lang.Class<? extends DynamicEntity> getJavaClass()
- Specified by:
getJavaClassin interfaceDynamicType
-
getMapping
public DatabaseMapping getMapping(java.lang.String propertyName)
-
getPropertiesNames
public java.util.List<java.lang.String> getPropertiesNames()
Description copied from interface:DynamicTypeThe current names of properties.Note: Some implementations support adding mapped attributes at runtime so it is best to avoid caching the result.
- Specified by:
getPropertiesNamesin interfaceDynamicType
-
getPropertyType
public java.lang.Class<?> getPropertyType(java.lang.String propertyName)
- Specified by:
getPropertyTypein interfaceDynamicType
-
newDynamicEntity
public DynamicEntity newDynamicEntity()
- Specified by:
newDynamicEntityin interfaceDynamicType
-
checkSet
public void checkSet(java.lang.String propertyName, java.lang.Object value) throws DynamicExceptionEnsure 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(java.lang.String propertyName)
- Specified by:
getPropertyIndexin interfaceDynamicType
-
getPropertyType
public java.lang.Class<?> getPropertyType(int propertyIndex)
- Specified by:
getPropertyTypein interfaceDynamicType
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-