org.eclipse.persistence.mappings.xdb
Class DirectToXMLTypeMapping
java.lang.Object
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
org.eclipse.persistence.mappings.DirectToFieldMapping
org.eclipse.persistence.mappings.xdb.DirectToXMLTypeMapping
- All Implemented Interfaces:
- java.io.Serializable, java.lang.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:
- Serialized Form
- Since:
- Toplink 10.1.3
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
attributeAccessor, attributeName, descriptor, fields, isDerivedIdMapping, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mappedByIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1 |
Method Summary |
void |
buildClone(java.lang.Object original,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL:
Build a clone of the Document for comparision at commit time. |
boolean |
compareObjects(java.lang.Object firstObject,
java.lang.Object secondObject,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the objects to see if an update is required. |
java.lang.Object |
getAttributeValue(java.lang.Object fieldValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Get the attribute value for the given field value. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
The mapping is initialized with the given session. |
boolean |
isDirectToXMLTypeMapping()
INTERNAL:
Related mapping should implement this method to return true. |
void |
setShouldReadWholeDocument(boolean readWholeDocument)
PUBLIC: |
boolean |
shouldReadWholeDocument()
PUBLIC: |
java.lang.Object |
valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL:
Return the mapping's attribute value from the row. |
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractDirectMapping |
addAdditionalFieldsToQuery, addFieldsForMapKey, addKeyToDeletedObjectsList, buildBackupClone, buildChangeRecord, buildCloneFromRow, buildCloneValue, buildCloneValue, buildCopy, buildElementClone, buildExpression, buildSelectionQueryForDirectCollectionKeyMapping, buildShallowOriginalFromRow, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, clone, collectFields, compareForChange, compareObjectValues, convertClassNamesToClasses, createMapComponentFromJoinedRow, createMapComponentFromRow, createQueryKeyForMapKey, deleteMapKey, extractIdentityFieldsForQuery, fixObjectReferences, getAdditionalSelectionCriteriaForMapKey, getAdditionalTablesForJoinQuery, getAllFieldsForMapKey, getAttributeClassification, getAttributeClassificationName, getAttributeValue, getConverter, getField, getFieldClassification, getFieldClassification, getFieldName, getFieldValue, getForeignKeyFieldsForMapKey, getIdentityFieldsForMapKey, getMapKeyTargetType, getNestedJoinQuery, getNullValue, getReferenceDescriptor, getTargetVersionOfSourceObject, getWeight, hasConverter, internalBuildChangeRecord, isAbstractDirectMapping, isChangeTrackingSupported, isCloningRequired, isDirectToFieldMapping, isMutable, iterate, iterateOnMapKey, mergeChangesIntoObject, mergeIntoObject, postInitializeMapValueSelectionQuery, preInitialize, preinitializeMapKey, remoteInitialization, setAttributeClassification, setAttributeClassificationName, setConverter, setConverterClassName, setField, setFieldClassification, setFieldType, setIsMutable, setNullValue, toString, unwrapKey, updateChangeRecord, validateBeforeInitialization, valueFromObject, valueFromResultSet, wrapKey, writeFromObjectIntoRow, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow |
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
buildBackupCloneForPartObject, buildCloneForPartObject, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, createUnitOfWorkValueHolder, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDescriptor, getFields, getGetMethodName, getMappedByIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMappedByIdValue, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCollectionMapping, isDatabaseMapping, isDerivedIdMapping, isDirectCollectionMapping, isDirectMapMapping, isEISMapping, isForeignReferenceMapping, isJoiningSupported, isLazy, isLockableMapping, isManyToManyMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, postInsert, postUpdate, preDelete, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDescriptor, setFields, setGetMethodName, setIsDerivedIdMapping, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMappedByIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.
DirectToXMLTypeMapping
public DirectToXMLTypeMapping()
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:
boolean
- - 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.
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.Object fieldValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
- 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.
- Throws:
DescriptorException
isDirectToXMLTypeMapping
public boolean isDirectToXMLTypeMapping()
- Description copied from class:
DatabaseMapping
- INTERNAL:
Related mapping should implement this method to return true.
- Overrides:
isDirectToXMLTypeMapping
in class DatabaseMapping
buildClone
public void buildClone(java.lang.Object original,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
- INTERNAL:
Build a clone of the Document for comparision at commit time.
- Overrides:
buildClone
in class AbstractDirectMapping
compareObjects
public boolean compareObjects(java.lang.Object firstObject,
java.lang.Object secondObject,
org.eclipse.persistence.internal.sessions.AbstractSession session)
- INTERNAL:
Compare the objects to see if an update is required. This is probably not
the best way to do this.
- Overrides:
compareObjects
in class AbstractDirectMapping
valueFromRow
public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
- Description copied from class:
AbstractDirectMapping
- INTERNAL:
Return the mapping's attribute value from the row.
The execution session is passed for the case of building a UnitOfWork clone
directly from a row, the session set in the query will not know which platform to use
for converting the value. Allows the correct session to be passed in.
- Overrides:
valueFromRow
in class AbstractDirectMapping