Class 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 Detail

      • 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:
        clone in class java.lang.Object
      • setDescriptor

        public void setDescriptor​(ClassDescriptor descriptor)
      • getParentType

        public DynamicType getParentType()
        Specified by:
        getParentType in interface DynamicType
        Returns:
        The parent type or null if this type does not have a persistent superclass
      • getClassName

        public java.lang.String getClassName()
        Specified by:
        getClassName in interface DynamicType
        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 interface DynamicType
      • getMappingsRequiringInitialization

        public java.util.Set<DatabaseMapping> getMappingsRequiringInitialization()
      • isInitialized

        public boolean isInitialized()
      • containsProperty

        public boolean containsProperty​(java.lang.String propertyName)
        Specified by:
        containsProperty in interface DynamicType
      • getMapping

        public DatabaseMapping getMapping​(java.lang.String propertyName)
      • getPropertiesNames

        public java.util.List<java.lang.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 interface DynamicType
      • getPropertyType

        public java.lang.Class<?> getPropertyType​(java.lang.String propertyName)
        Specified by:
        getPropertyType in interface DynamicType
      • checkSet

        public void checkSet​(java.lang.String propertyName,
                             java.lang.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​(java.lang.String propertyName)
        Specified by:
        getPropertyIndex in interface DynamicType
      • getPropertyType

        public java.lang.Class<?> getPropertyType​(int propertyIndex)
        Specified by:
        getPropertyType in interface DynamicType
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object