Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.oxm.mappings
Class XMLBinaryDataCollectionMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping
          extended by org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping
              extended by org.eclipse.persistence.oxm.mappings.XMLBinaryDataCollectionMapping

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping, XMLMapping, XMLNillableMapping

public class XMLBinaryDataCollectionMapping
extends XMLCompositeDirectCollectionMapping

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

Responsibilities:

XMLBinaryDataCollectionMapping represents a mapping of a collection 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 types 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

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

Nested Class Summary

 

Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType

 

Field Summary
private  java.lang.Class collectionContentType
           
private static java.lang.String INCLUDE
           
private  boolean isSwaRef
           
private  MimeTypePolicy mimeTypePolicy
           
private  boolean shouldInlineBinaryData
           

 

Fields inherited from class org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping
reuseContainer

 

Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping
elementDataTypeName, field, valueConverter

 

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
XMLBinaryDataCollectionMapping()
           

 

Method Summary
 java.lang.Class getAttributeElementClass()
          PUBLIC: Return the class each element in the object's collection should be converted to, before the collection is inserted into the object.
 java.lang.Class getCollectionContentType()
           
 java.lang.String getMimeType()
          INTERNAL
 java.lang.String getMimeType(java.lang.Object anObject)
          INTERNAL
 MimeTypePolicy getMimeTypePolicy()
           
 java.lang.Object getValueToWrite(java.lang.Object value, java.lang.Object parent, XMLRecord record, XMLField field, XMLField includeField, org.eclipse.persistence.internal.sessions.AbstractSession session)
           
 boolean isAbstractCompositeDirectCollectionMapping()
          INTERNAL:
 boolean isSwaRef()
           
 void setAttributeElementClass(java.lang.Class attributeElementClass)
          PUBLIC: Set the class each element in the object's collection should be converted to, before the collection is inserted into the object.
 void setCollectionContentType(java.lang.Class javaClass)
           
 void setMimeType(java.lang.String mimeTypeString)
          Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument
 void setMimeTypePolicy(MimeTypePolicy mimeTypePolicy)
          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, java.lang.Boolean[] wasCacheUsed)
          INTERNAL: Build the nested collection from the database 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:
 void writeSingleValue(java.lang.Object value, 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.XMLCompositeDirectCollectionMapping
getNullPolicy, getReuseContainer, getXPath, initialize, isCDATA, isWriteOnly, isXMLMapping, preInitialize, setAttributeValueInObject, setIsCDATA, setIsWriteOnly, setNullPolicy, setReuseContainer, useCollectionClassName

 

Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping
buildAddedElementFromChangeSet, buildBackupClone, buildChangeSet, buildClone, buildCloneFromRow, buildClonePart, buildCopy, buildElementFromChangeSet, buildElementFromElement, buildRemovedElementFromChangeSet, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, collectFields, compareElements, compareElementsForChange, compareForChange, compareObjects, convertClassNamesToClasses, convertToChangeRecord, fixObjectReferences, getContainerPolicy, getField, getFieldClassification, getFieldElementClass, getFieldName, getRealCollectionAttributeValueFromObject, getValueConverter, hasValueConverter, isCollectionMapping, iterate, mapKeyHasChanged, mergeChangesIntoObject, mergeIntoObject, setContainerPolicy, setField, setFieldElementClass, setUsesSingleNode, setValueConverter, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, useCollectionClass, useMapClass, usesSingleNode, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow

 

Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, clone, cloneFields, collectQueryParameters, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDerivedIdMapping, getDescriptor, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getReferenceDescriptor, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, 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, remoteInitialization, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, toString, updateChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

shouldInlineBinaryData

private boolean shouldInlineBinaryData

mimeTypePolicy

private MimeTypePolicy mimeTypePolicy

isSwaRef

private boolean isSwaRef

collectionContentType

private java.lang.Class collectionContentType

INCLUDE

private static final java.lang.String INCLUDE
See Also:
Constant Field Values

Constructor Detail

XMLBinaryDataCollectionMapping

public XMLBinaryDataCollectionMapping()

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 mimeTypePolicy)
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)

isAbstractCompositeDirectCollectionMapping

public boolean isAbstractCompositeDirectCollectionMapping()
Description copied from class: AbstractCompositeDirectCollectionMapping
INTERNAL:
Overrides:
isAbstractCompositeDirectCollectionMapping in class AbstractCompositeDirectCollectionMapping

setXPath

public void setXPath(java.lang.String xpathString)
Set the Mapping field name attribute to the given XPath String
Overrides:
setXPath in class XMLCompositeDirectCollectionMapping
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: XMLCompositeDirectCollectionMapping
INTERNAL:
Overrides:
writeFromObjectIntoRow in class XMLCompositeDirectCollectionMapping

getValueToWrite

public java.lang.Object getValueToWrite(java.lang.Object value,
                                        java.lang.Object parent,
                                        XMLRecord record,
                                        XMLField field,
                                        XMLField includeField,
                                        org.eclipse.persistence.internal.sessions.AbstractSession session)

writeSingleValue

public void writeSingleValue(java.lang.Object value,
                             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 XMLCompositeDirectCollectionMapping
Parameters:
value - - 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,
                                     java.lang.Boolean[] wasCacheUsed)
Description copied from class: XMLCompositeDirectCollectionMapping
INTERNAL: Build the nested collection from the database row.
Overrides:
valueFromRow in class XMLCompositeDirectCollectionMapping

setCollectionContentType

public void setCollectionContentType(java.lang.Class javaClass)

getCollectionContentType

public java.lang.Class getCollectionContentType()

setAttributeElementClass

public void setAttributeElementClass(java.lang.Class attributeElementClass)
PUBLIC: Set the class each element in the object's collection should be converted to, before the collection is inserted into the object. This is optional - if left null, the elements will be added to the object's collection unconverted.
Overrides:
setAttributeElementClass in class AbstractCompositeDirectCollectionMapping

getAttributeElementClass

public java.lang.Class getAttributeElementClass()
Description copied from class: AbstractCompositeDirectCollectionMapping
PUBLIC: Return the class each element in the object's collection should be converted to, before the collection is inserted into the object. This is optional - if left null, the elements will be added to the object's collection unconverted.
Overrides:
getAttributeElementClass in class AbstractCompositeDirectCollectionMapping

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.