EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.oxm.mappings
Class XMLBinaryDataMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
          extended by org.eclipse.persistence.oxm.mappings.XMLDirectMapping
              extended by org.eclipse.persistence.oxm.mappings.XMLBinaryDataMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, MapComponentMapping, MapKeyMapping, XMLMapping, XMLNillableMapping

public class XMLBinaryDataMapping
extends XMLDirectMapping

Purpose:Provide a mapping for binary data that can be treated as either inline or as an attachment.

Responsibilities:

XMLBinaryDataMapping represents a mapping of binary data in the object model to XML. This can either be written directly as inline binary data (base64) or passed through as an MTOM or SWAREF attachment.

The following typed are allowable to be mapped using an XMLBinaryDataMapping:

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 node for the binary mapping. The XPath is specified on the mapping using the setXPath method.

Inline Binary Data: Set this flag if you want to always inline binary data for this mapping. This will disable consideration for attachment handling for this mapping.

SwaRef: Set this flag in order to specify that the target node of this mapping is of type xs:swaref

See Also:
XMLAttachmentMarshaller, XMLAttachmentUnmarshaller, MimeTypePolicy, Serialized Form
Since:
TopLink 11.1.1.0.0g

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, converter, converterClassName, field, fieldClassificationClassName, isInsertable, isMutable, isUpdatable, keyTableForMapKey, nullValue
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
 
Constructor Summary
XMLBinaryDataMapping()
           
 
Method Summary
 java.lang.String getMimeType()
          INTERNAL
 java.lang.String getMimeType(java.lang.Object anObject)
          INTERNAL
 MimeTypePolicy getMimeTypePolicy()
           
 boolean isAbstractDirectMapping()
          INTERNAL:
 boolean isSwaRef()
           
 void setMimeType(java.lang.String mimeTypeString)
          Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument
 void setMimeTypePolicy(MimeTypePolicy aPolicy)
          Allow implementer to set the MimeTypePolicy class FixedMimeTypePolicy or AttributeMimeTypePolicy (dynamic)
 void setShouldInlineBinaryData(boolean b)
           
 void setSwaRef(boolean swaRef)
           
 void setXPath(java.lang.String xpathString)
          Set the Mapping field name attribute to the given XPath String
 boolean shouldInlineBinaryData()
           
 java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected)
          INTERNAL: Return the mapping's attribute value from the row.
 void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
          INTERNAL: Get a value from the object and set that in the respective field of the row.
 void writeSingleValue(java.lang.Object attributeValue, java.lang.Object parent, XMLRecord record, org.eclipse.persistence.internal.sessions.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
getAttributeValue, getFieldValue, getNullPolicy, getXPath, initialize, isCDATA, isWriteOnly, isXMLMapping, preInitialize, setAttributeValueInObject, setIsCDATA, setIsWriteOnly, setNullPolicy, 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, clone, collectFields, compareForChange, compareObjects, compareObjectValues, convertClassNamesToClasses, createMapComponentFromJoinedRow, createMapComponentFromRow, createMapComponentFromSerializableKeyInfo, createQueryKeyForMapKey, createSerializableMapKeyInfo, 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, isChangeTrackingSupported, isCloningRequired, isDirectToFieldMapping, isMutable, iterate, iterateOnMapKey, mergeChangesIntoObject, mergeIntoObject, postInitializeMapKey, preinitializeMapKey, remoteInitialization, requiresDataModificationEventsForMapKey, setAttributeClassification, setAttributeClassificationName, setConverter, setConverterClassName, setField, setFieldClassification, setFieldClassificationClassName, setFieldType, setIsMutable, setNullValue, toString, unwrapKey, updateChangeRecord, validateBeforeInitialization, valueFromObject, valueFromResultSet, wrapKey, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildBackupCloneForPartObject, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge_, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToXMLTypeMapping, isEISMapping, isForeignReferenceMapping, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, postInsert, postUpdate, preDelete, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLBinaryDataMapping

public XMLBinaryDataMapping()
Method Detail

shouldInlineBinaryData

public boolean shouldInlineBinaryData()

setShouldInlineBinaryData

public void setShouldInlineBinaryData(boolean b)

getMimeType

public java.lang.String getMimeType(java.lang.Object anObject)
INTERNAL


getMimeType

public java.lang.String getMimeType()
INTERNAL


getMimeTypePolicy

public MimeTypePolicy getMimeTypePolicy()

setMimeTypePolicy

public void setMimeTypePolicy(MimeTypePolicy aPolicy)
Allow implementer to set the MimeTypePolicy class FixedMimeTypePolicy or AttributeMimeTypePolicy (dynamic)

Parameters:
aPolicy - MimeTypePolicy

setMimeType

public void setMimeType(java.lang.String mimeTypeString)
Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument

Parameters:
mimeTypeString -

isSwaRef

public boolean isSwaRef()

setSwaRef

public void setSwaRef(boolean swaRef)

setXPath

public void setXPath(java.lang.String xpathString)
Set the Mapping field name attribute to the given XPath String

Overrides:
setXPath in class XMLDirectMapping
Parameters:
xpathString - String

writeFromObjectIntoRow

public void writeFromObjectIntoRow(java.lang.Object object,
                                   org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                   org.eclipse.persistence.internal.sessions.AbstractSession session,
                                   DatabaseMapping.WriteType writeType)
Description copied from class: XMLDirectMapping
INTERNAL: Get a value from the object and set that in the respective field of the row.

Overrides:
writeFromObjectIntoRow in class XMLDirectMapping

writeSingleValue

public void writeSingleValue(java.lang.Object attributeValue,
                             java.lang.Object parent,
                             XMLRecord record,
                             org.eclipse.persistence.internal.sessions.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 interface XMLMapping
Overrides:
writeSingleValue in class XMLDirectMapping
Parameters:
attributeValue - - The value to be marshalled
record - - The Record the value is being marshalled too.

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.identitymaps.CacheKey cacheKey,
                                     org.eclipse.persistence.internal.sessions.AbstractSession executionSession,
                                     boolean isTargetProtected)
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 class XMLDirectMapping

isAbstractDirectMapping

public boolean isAbstractDirectMapping()
Description copied from class: AbstractDirectMapping
INTERNAL:

Overrides:
isAbstractDirectMapping in class AbstractDirectMapping

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference