public class XMLBinaryDataMapping extends XMLDirectMapping implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>
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
XMLAttachmentMarshaller,
XMLAttachmentUnmarshaller,
MimeTypePolicy,
Serialized FormDatabaseMapping.WriteTypeisCDATAattributeClassification, attributeClassificationName, attributeObjectClassification, bypassDefaultNullValueCheck, fieldClassificationClassName, isMutable, keyTableForMapKey, nullValueconverter, converterClassName, field, isInsertable, isUpdatableattributeAccessor, 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 and Description |
|---|
XMLBinaryDataMapping() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getMimeType()
INTERNAL
|
java.lang.String |
getMimeType(java.lang.Object anObject)
INTERNAL
|
MimeTypePolicy |
getMimeTypePolicy() |
boolean |
isAbstractColumnMapping()
INTERNAL:
|
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,
java.lang.Boolean[] wasCacheUsed)
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.
|
convertDataValueToObjectValue, convertObjectValueToDataValue, getAttributeValue, getFieldValue, getNullPolicy, getXPath, initialize, isCDATA, isCloningRequired, isCollapsingStringValues, isNormalizingStringValues, isNullValueMarshalled, isWriteOnly, isXMLMapping, preInitialize, setAttributeValueInObject, setCollapsingStringValues, setIsCDATA, setIsWriteOnly, setNormalizingStringValues, setNullPolicy, setNullValueMarshalled, writeValueIntoRowaddAdditionalFieldsToQuery, addFieldsForMapKey, addKeyToDeletedObjectsList, buildBackupClone, buildChangeRecord, buildClone, buildCloneFromRow, buildCloneValue, buildCloneValue, buildCopy, buildElementClone, buildExpression, buildSelectionQueryForDirectCollectionKeyMapping, buildShallowOriginalFromRow, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, clone, compareForChange, compareObjects, compareObjectValues, convertClassNamesToClasses, createMapComponentFromJoinedRow, createMapComponentFromRow, createMapComponentsFromSerializableKeyInfo, createQueryKeyForMapKey, createSerializableMapKeyInfo, createStubbedMapComponentFromSerializableKeyInfo, deleteMapKey, extractIdentityFieldsForQuery, getAdditionalSelectionCriteriaForMapKey, getAdditionalTablesForJoinQuery, getAllFieldsForMapKey, getAttributeClassification, getAttributeClassificationName, getFieldClassification, getFieldClassification, 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, writeUpdateFieldsIntoRowcollectFields, fixObjectReferences, getConverter, getField, hasConverter, isInsertable, isUpdatable, iterate, setConverter, setConverterClassName, setFieldaddUnconvertedProperty, buildBackupCloneForPartObject, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, convertConverterClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, 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, 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, writeFromObjectIntoRowForWhereClauseequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNullPolicy, getObjectValue, getXPath, setAttributeClassification, setAttributeClassificationName, setConverter, setField, setIsWriteOnly, setNullPolicyconvertClassNamesToClasses, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDescriptor, getField, getReferenceDescriptor, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isCollectionMapping, isReadOnly, isReferenceMapping, isTransformationMapping, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setGetMethodName, setIsReadOnly, setProperties, setSetMethodNameconvertDataValueToObjectValue, convertObjectValueToDataValueconvertClassNamesToClassespublic boolean shouldInlineBinaryData()
shouldInlineBinaryData in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>public void setShouldInlineBinaryData(boolean b)
setShouldInlineBinaryData in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>public java.lang.String getMimeType(java.lang.Object anObject)
getMimeType in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>public java.lang.String getMimeType()
getMimeType in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>public MimeTypePolicy getMimeTypePolicy()
public void setMimeTypePolicy(MimeTypePolicy aPolicy)
setMimeTypePolicy in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>aPolicy - MimeTypePolicypublic void setMimeType(java.lang.String mimeTypeString)
setMimeType in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>mimeTypeString - public boolean isSwaRef()
isSwaRef in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>public void setSwaRef(boolean swaRef)
setSwaRef in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>public void setXPath(java.lang.String xpathString)
setXPath in interface org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,MimeTypePolicy,Session,XMLUnmarshaller,XMLRecord>setXPath in interface org.eclipse.persistence.internal.oxm.mappings.DirectMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,Converter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,XMLUnmarshaller,XMLRecord>setXPath in class XMLDirectMappingxpathString - Stringpublic void writeFromObjectIntoRow(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
XMLDirectMappingwriteFromObjectIntoRow in class XMLDirectMappingpublic void writeSingleValue(java.lang.Object attributeValue,
java.lang.Object parent,
XMLRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
XMLMappingwriteSingleValue in interface org.eclipse.persistence.internal.oxm.mappings.Mapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLRecord>writeSingleValue in interface XMLMappingwriteSingleValue in class XMLDirectMappingattributeValue - - The value to be marshalledrecord - - The Record the value is being marshalled too.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)
XMLDirectMappingvalueFromRow in class XMLDirectMappingpublic boolean isAbstractDirectMapping()
AbstractDirectMappingisAbstractDirectMapping in interface org.eclipse.persistence.internal.oxm.mappings.Mapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLRecord>isAbstractDirectMapping in class AbstractDirectMappingpublic boolean isAbstractColumnMapping()
AbstractColumnMappingisAbstractColumnMapping in class AbstractColumnMapping