Class DirectToXMLTypeMapping

java.lang.Object
org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField>
All Implemented Interfaces:
Serializable, Cloneable, MapComponentMapping, MapKeyMapping, RelationalMapping

public class DirectToXMLTypeMapping extends DirectToFieldMapping
Purpose: Mapping used to map from a DOM (org.w3c.Document) or XML String into an Oracle XMLType field, in Oracle 9i XDB.
See Also:
  • Field Details

    • shouldReadWholeDocument

      protected boolean shouldReadWholeDocument
      Indicates if we should initialize the whole DOM on a read. This is only used if the user is mapping from an Oracle Document implementation.
  • Constructor Details

    • DirectToXMLTypeMapping

      public DirectToXMLTypeMapping()
  • Method Details

    • preInitialize

      public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
      INTERNAL: Default to mutable if mapped as a DOM.
      Overrides:
      preInitialize in class AbstractDirectMapping
      Throws:
      DescriptorException
    • initialize

      public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
      INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.
      Overrides:
      initialize in class AbstractDirectMapping
      Throws:
      DescriptorException
    • setShouldReadWholeDocument

      public void setShouldReadWholeDocument(boolean readWholeDocument)
      PUBLIC:
      Parameters:
      readWholeDocument - - determines if the Oracle XDB DOM should be fully initialized on a read.
    • shouldReadWholeDocument

      public boolean shouldReadWholeDocument()
      PUBLIC:
      Returns:
      boolean - returns true if currently initializing DOMs on reads.
    • getObjectValue

      public Object getObjectValue(Object fieldValue, Session session) throws ConversionException
      INTERNAL: Get the attribute value for the given field value. If we're mapping to a Document, we need to check if we should return the Oracle DOM or build a new one.
      Overrides:
      getObjectValue in class AbstractDirectMapping
      Throws:
      ConversionException
    • isDirectToXMLTypeMapping

      public boolean isDirectToXMLTypeMapping()
      Description copied from class: DatabaseMapping
      INTERNAL: Related mapping should implement this method to return true.
      Overrides:
      isDirectToXMLTypeMapping in class DatabaseMapping
    • buildCloneValue

      protected Object buildCloneValue(Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
      INTERNAL: Clone the DOM Document if required.
      Overrides:
      buildCloneValue in class AbstractDirectMapping
    • compareObjectValues

      protected boolean compareObjectValues(Object firstValue, Object secondValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
      INTERNAL: Compare the attribute values. Compare Nodes if mapped as a DOM.
      Overrides:
      compareObjectValues in class AbstractDirectMapping