Interface Descriptor<ATTRIBUTE_ACCESSOR extends CoreAttributeAccessor,​CORE_MAPPING extends CoreMapping,​FIELD extends CoreField,​INHERITANCE_POLICY extends CoreInheritancePolicy,​INSTANTIATION_POLICY extends CoreInstantiationPolicy,​NAMESPACE_RESOLVER extends NamespaceResolver,​OBJECT_BUILDER extends CoreObjectBuilder,​TABLE extends CoreTable,​UNMARSHAL_RECORD extends UnmarshalRecord,​UNMARSHALLER extends Unmarshaller>

    • Method Detail

      • addMapping

        CORE_MAPPING addMapping​(CORE_MAPPING mapping)
        Add a database mapping to the receiver. Perform any required initialization of both the mapping and the receiving descriptor as a result of adding the new mapping.
      • addPrimaryKeyField

        void addPrimaryKeyField​(FIELD field)
        ADVANCED: Specify the primary key field of the descriptors table. This should be called for each field that makes up the primary key of the table. This can be used for advanced field types, such as XML nodes, or to set the field type.
      • addRootElement

        void addRootElement​(String rootElementName)
        Add a root element name for the Descriptor This value is stored in place of a table name
        Parameters:
        rootElementName - a root element to specify on this Descriptor
      • getAlias

        String getAlias()
        Get the alias
      • getDefaultRootElement

        String getDefaultRootElement()
        Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects
        Returns:
        the default root element specified on this ClassDescriptor
      • getDefaultRootElementType

        QName getDefaultRootElementType()
      • getDefaultRootElementField

        Field getDefaultRootElementField()
      • getInheritancePolicy

        INHERITANCE_POLICY getInheritancePolicy()
        The inheritance policy is used to define how a descriptor takes part in inheritance. All inheritance properties for both child and parent classes is configured in inheritance policy. Caution must be used in using this method as it lazy initializes an inheritance policy. Calling this on a descriptor that does not use inheritance will cause problems, #hasInheritance() must always first be called.
      • getInheritancePolicyOrNull

        INHERITANCE_POLICY getInheritancePolicyOrNull()
        INTERNAL: Return the inheritance policy.
      • getInstantiationPolicy

        INSTANTIATION_POLICY getInstantiationPolicy()
        INTERNAL: Returns the instantiation policy.
      • getJavaClass

        Class getJavaClass()
        Return the java class.
      • getJavaClassName

        String getJavaClassName()
        Return the class name, used by the MW.
      • getLocationAccessor

        ATTRIBUTE_ACCESSOR getLocationAccessor()
        INTERNAL: Returns this Descriptor's location accessor, if one is defined.
      • getMappingForAttributeName

        CORE_MAPPING getMappingForAttributeName​(String attributeName)
        Returns the mapping associated with a given attribute name. This can be used to find a descriptors mapping in a amendment method before the descriptor has been initialized.
      • getNamespaceResolver

        NAMESPACE_RESOLVER getNamespaceResolver()
        Return the NamespaceResolver associated with this descriptor
        Returns:
        the NamespaceResolver associated with this descriptor
      • getObjectBuilder

        OBJECT_BUILDER getObjectBuilder()
        INTERNAL: Return the object builder
      • getPrimaryKeyFieldNames

        Vector<String> getPrimaryKeyFieldNames()
        Return the names of all the primary keys.
      • getPrimaryKeyFields

        List<FIELD> getPrimaryKeyFields()
        INTERNAL: Return all the primary key fields
      • getTableNames

        Vector getTableNames()
        Return the table names.
      • getTables

        Vector<TABLE> getTables()
        INTERNAL: Return all the tables.
      • getTypedField

        FIELD getTypedField​(FIELD field)
        INTERNAL: searches first descriptor than its ReturningPolicy for an equal field
      • hasInheritance

        boolean hasInheritance()
        INTERNAL: Return if this descriptor is involved in inheritance, (is child or parent). Note: If this class is part of table per class inheritance strategy this method will return false.
      • isLazilyInitialized

        boolean isLazilyInitialized()
        If true, the descriptor may be lazily initialized. This is useful if the descriptor may not get used.
      • isResultAlwaysXMLRoot

        boolean isResultAlwaysXMLRoot()
      • isSequencedObject

        boolean isSequencedObject()
        INTERNAL:

        Indicates if the Object mapped by this descriptor is a sequenced data object and should be marshalled accordingly.

      • isWrapper

        boolean isWrapper()
      • setDefaultRootElement

        void setDefaultRootElement​(String newDefaultRootElement)
        Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects
        Parameters:
        newDefaultRootElement - the default root element to specify on this ClassDescriptor
      • setInstantiationPolicy

        void setInstantiationPolicy​(INSTANTIATION_POLICY instantiationPolicy)
        INTERNAL: Sets the instantiation policy.
      • setJavaClass

        void setJavaClass​(Class theJavaClass)
        Set the Java class that this descriptor maps. Every descriptor maps one and only one class.
      • setJavaClassName

        void setJavaClassName​(String theJavaClassName)
        INTERNAL: Return the java class name, used by the MW.
      • setLocationAccessor

        void setLocationAccessor​(ATTRIBUTE_ACCESSOR attributeAccessor)
        INTERNAL: Set this Descriptor's location accessor.
      • setNamespaceResolver

        void setNamespaceResolver​(NAMESPACE_RESOLVER newNamespaceResolver)
        Set the NamespaceResolver to associate with this descriptor
        Parameters:
        newNamespaceResolver - the NamespaceResolver to associate with this descriptor
      • setProperties

        void setProperties​(Map properties)
        INTERNAL: Set the user defined properties.
      • setResultAlwaysXMLRoot

        void setResultAlwaysXMLRoot​(boolean resultAlwaysXMLRoot)
      • setSchemaReference

        void setSchemaReference​(XMLSchemaReference newSchemaReference)
        Set the SchemaReference to associate with this descriptor
        Parameters:
        newSchemaReference - the SchemaReference to associate with this descriptor
        See Also:
        org.eclipse.persistence.oxm.schema
      • shouldPreserveDocument

        boolean shouldPreserveDocument()
        Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.
        Returns:
        if this descriptor should preserve unmapped data
      • wrapObjectInXMLRoot

        Object wrapObjectInXMLRoot​(Object object,
                                   String elementNamespaceUri,
                                   String elementLocalName,
                                   String elementPrefix,
                                   boolean forceWrap,
                                   boolean isNamespaceAware,
                                   UNMARSHALLER xmlUnmarshaller)
        INTERNAL: Determines the appropriate object to return from the unmarshal call. The method will either return the object created in the xmlReader.parse() call or an instance of XMLRoot. An XMLRoot instance will be returned if the DOMRecord element being unmarshalled does not equal the descriptor's default root element.
        Parameters:
        object -
        elementNamespaceUri -
        elementLocalName -
        elementPrefix -
        Returns:
        object
      • wrapObjectInXMLRoot

        Object wrapObjectInXMLRoot​(UNMARSHAL_RECORD unmarshalRecord,
                                   boolean forceWrap)
        INTERNAL: Determines the appropriate object to return from the unmarshal call. The method will either return the object created in the xmlReader.parse() call or an instance of XMLRoot. An XMLRoot instance will be returned if the DOMRecord element being unmarshalled does not equal the descriptor's default root element.
        Parameters:
        unmarshalRecord -
        Returns:
        object