Module org.eclipse.persistence.core
Class XMLFragmentMapping
java.lang.Object
org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,AbstractSession,ContainerPolicy,ClassDescriptor,DatabaseField>
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
org.eclipse.persistence.oxm.mappings.XMLDirectMapping
org.eclipse.persistence.oxm.mappings.XMLFragmentMapping
- All Implemented Interfaces:
Serializable
,Cloneable
,DirectMapping<AbstractSession,
,AttributeAccessor, ContainerPolicy, Converter, ClassDescriptor, DatabaseField, XMLMarshaller, Session, XMLUnmarshaller, XMLRecord> FragmentMapping<AbstractSession,
,AttributeAccessor, ContainerPolicy, ClassDescriptor, DatabaseField, Session, XMLRecord> Mapping<AbstractSession,
,AttributeAccessor, ContainerPolicy, ClassDescriptor, DatabaseField, XMLRecord> XMLConverterMapping<XMLMarshaller,
,Session, XMLUnmarshaller> MapComponentMapping
,MapKeyMapping
,XMLMapping
,XMLNillableMapping
public class XMLFragmentMapping
extends XMLDirectMapping
implements FragmentMapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,Session,XMLRecord>
Purpose: This mapping provides a means to keep a part of the xml tree as a DOM element.
Setting the XPath: TopLink XML mappings make use of XPath statements to find the relevant
data in an XML document. The XPath statement is relative to the context node specified in the descriptor.
The XPath may contain path and positional information; the last node in the XPath forms the local
root node for the fragment. The XPath is specified on the mapping using the setXPath
method.
XPath | Description |
---|---|
phone-number | The phone-number information is stored in the phone-number element. |
contact-info/phone-number | The XPath statement may be used to specify any valid path. |
Sample Configuration:
XMLFragmentCollectionMapping mapping = new XMLFragmentCollectionMapping();
mapping.setAttributeName("phoneNumber");
mapping.setXPath("contact-info/phone-number");
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
Field Summary
Fields inherited from class org.eclipse.persistence.oxm.mappings.XMLDirectMapping
isCDATA
Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
attributeClassification, attributeClassificationName, attributeObjectClassification, bypassDefaultNullValueCheck, fieldClassificationClassName, isMutable, keyTableForMapKey, nullValue
Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
converter, converterClassName, field, isInsertable, isUpdatable
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
INTERNAL:boolean
INTERNAL:void
Set the Mapping field name attribute to the given XPath StringvalueFromRow
(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) INTERNAL: Return the mapping's attribute value from the row.void
writeFromObjectIntoRow
(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeSingleValue
(Object attributeValue, Object parent, XMLRecord row, AbstractSession session) INTERNAL: A method that marshals a single value to the provided Record based on this mapping's XPath.Methods inherited from class org.eclipse.persistence.oxm.mappings.XMLDirectMapping
convertDataValueToObjectValue, convertObjectValueToDataValue, getAttributeValue, getFieldValue, getNullPolicy, getXPath, initialize, isCDATA, isCloningRequired, isCollapsingStringValues, isNormalizingStringValues, isNullValueMarshalled, isWriteOnly, isXMLMapping, preInitialize, setAttributeValueInObject, setCollapsingStringValues, setIsCDATA, setIsWriteOnly, setNormalizingStringValues, setNullPolicy, setNullValueMarshalled, writeValueIntoRow
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
addAdditionalFieldsToQuery, addFieldsForMapKey, addKeyToDeletedObjectsList, buildBackupClone, buildChangeRecord, buildClone, buildCloneFromRow, buildCloneValue, buildCloneValue, buildCopy, buildElementClone, buildExpression, buildSelectionQueryForDirectCollectionKeyMapping, buildShallowOriginalFromRow, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, compareForChange, compareObjects, compareObjectValues, convertClassNamesToClasses, createMapComponentFromJoinedRow, createMapComponentFromRow, createMapComponentsFromSerializableKeyInfo, createQueryKeyForMapKey, createSerializableMapKeyInfo, createStubbedMapComponentFromSerializableKeyInfo, deleteMapKey, extractIdentityFieldsForQuery, getAdditionalSelectionCriteriaForMapKey, getAdditionalTablesForJoinQuery, getAllFieldsForMapKey, getAttributeClassification, getAttributeClassificationName, getFieldClassification, getFieldClassification, getFieldClassificationClassName, getFieldName, getFieldValue, getForeignKeyFieldsForMapKey, getIdentityFieldsForMapKey, getMapKeyTargetType, getNestedJoinQuery, getNullValue, getObjectValue, getObjectValueWithoutClassCheck, getReferenceDescriptor, getTargetVersionOfSourceObject, getWeight, internalBuildChangeRecord, isChangeTrackingSupported, isDirectToFieldMapping, isMutable, iterateOnMapKey, mergeChangesIntoObject, mergeIntoObject, postInitializeMapKey, preinitializeMapKey, remoteInitialization, requiresDataModificationEventsForMapKey, setAttributeClassification, setAttributeClassificationName, setFieldClassification, setFieldClassificationClassName, setFieldType, setIsMutable, setNullValue, toString, unwrapKey, updateChangeRecord, validateBeforeInitialization, valueFromObject, valueFromResultSet, wrapKey, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
clone, collectFields, fixObjectReferences, getConverter, getField, hasConverter, isInsertable, isUpdatable, iterate, setConverter, setConverterClassName, setField
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildBackupCloneForPartObject, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, convertConverterClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getValueFromRemoteValueHolder, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasNestedIdentityReference, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isAttributeValueFromObjectInstantiated, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isForeignReferenceMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, iterateOnRealAttributeValue, load, loadAll, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, postInitializeSourceAndTargetExpressions, postInsert, postUpdate, preDelete, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.internal.oxm.mappings.DirectMapping
getConverter, getNullValue, getObjectValue, hasConverter, setAttributeClassification, setAttributeClassificationName, setConverter, setField, setNullValue, valueFromObject
Methods inherited from interface org.eclipse.persistence.internal.oxm.mappings.FragmentMapping
getObjectValue, getXPath
Methods inherited from interface org.eclipse.persistence.mappings.foundation.MapComponentMapping
clone
Methods inherited from interface org.eclipse.persistence.internal.oxm.mappings.Mapping
getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDescriptor, getField, getReferenceDescriptor, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isCollectionMapping, isReadOnly, isReferenceMapping, isTransformationMapping, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setGetMethodName, setIsReadOnly, setProperties, setSetMethodName
Methods inherited from interface org.eclipse.persistence.oxm.mappings.XMLMapping
convertClassNamesToClasses
-
Constructor Details
-
XMLFragmentMapping
public XMLFragmentMapping()
-
-
Method Details
-
writeFromObjectIntoRow
public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRow
in classXMLDirectMapping
-
valueFromRow
public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) Description copied from class:XMLDirectMapping
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 classXMLDirectMapping
-
writeSingleValue
public void writeSingleValue(Object attributeValue, Object parent, XMLRecord row, AbstractSession session) Description copied from interface:XMLMapping
INTERNAL: A method that marshals a single value to the provided Record based on this mapping's XPath. Used for Sequenced marshalling.- Specified by:
writeSingleValue
in interfaceMapping<AbstractSession,
AttributeAccessor, ContainerPolicy, ClassDescriptor, DatabaseField, XMLRecord> - Specified by:
writeSingleValue
in interfaceXMLMapping
- Overrides:
writeSingleValue
in classXMLDirectMapping
- Parameters:
attributeValue
- - The value to be marshalledrow
- - The Record the value is being marshalled too.
-
setXPath
Description copied from class:XMLDirectMapping
Set the Mapping field name attribute to the given XPath String- Specified by:
setXPath
in interfaceDirectMapping<AbstractSession,
AttributeAccessor, ContainerPolicy, Converter, ClassDescriptor, DatabaseField, XMLMarshaller, Session, XMLUnmarshaller, XMLRecord> - Overrides:
setXPath
in classXMLDirectMapping
- Parameters:
xpathString
- String
-
isAbstractDirectMapping
public boolean isAbstractDirectMapping()Description copied from class:AbstractDirectMapping
INTERNAL:- Specified by:
isAbstractDirectMapping
in interfaceMapping<AbstractSession,
AttributeAccessor, ContainerPolicy, ClassDescriptor, DatabaseField, XMLRecord> - Overrides:
isAbstractDirectMapping
in classAbstractDirectMapping
- Returns:
- TODO
-
isAbstractColumnMapping
public boolean isAbstractColumnMapping()Description copied from class:AbstractColumnMapping
INTERNAL:- Overrides:
isAbstractColumnMapping
in classAbstractColumnMapping
-