Class XMLAnyCollectionMapping
- java.lang.Object
-
- org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField>
-
- org.eclipse.persistence.mappings.DatabaseMapping
-
- org.eclipse.persistence.oxm.mappings.XMLAbstractAnyMapping
-
- org.eclipse.persistence.oxm.mappings.XMLAnyCollectionMapping
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>,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>,org.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping,org.eclipse.persistence.internal.oxm.mappings.XMLConverterMapping<XMLMarshaller,Session,XMLUnmarshaller>,ContainerMapping,XMLMapping
public class XMLAnyCollectionMapping extends XMLAbstractAnyMapping implements org.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>, XMLMapping, ContainerMapping
Any collection XML mappings map an attribute that contains a heterogenous collection of objects to multiple XML elements. Unlike composite collection XML mappings, the referenced objects may be of different types (including String), and do not need to be related to each other through inheritance or a common interface. The corresponding object attribute should be generic enough for all possible application values. Note that each of the referenced objects (except String) must specify a default root element on their descriptor.
Any collection mappings are useful with the following XML schema constructs:
- any
- choice
- substitution groups
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 node type, path, and positional information. The XPath is specified on the mapping using the
setXPathmethod. Note that for XML Any Collection Mappings the XPath is optional.The following XPath statements may be used to specify the location of XML data relating to an object's name attribute:
XPath Description contact-methods The name information is stored in the contact-methods element. contact-methods/info The XPath statement may be used to specify any valid path. contact-methods[2] The XPath statement may contain positional information. In this case the contact information is stored in the second occurrence of the contact-methods element. Mapping an element of type xs:anyType as an Any Collection Mapping:
XML Schema
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="customer" type="customer-type"/>
<xsd:complexType name="customer-type">
<xsd:sequence>
<xsd:element name="contact-methods" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="address">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="phone-number" type="xsd:string"/>
</xsd:schema>
Code Sample
XMLAnyCollectionMapping contactMethodsMapping = new XMLAnyCollectionMapping();
contactMethodsMapping.setAttributeName("contactMethods");
contactMethodsMapping.setXPath("contact-methods");
More Information: For more information about using the XML Any Collection Mapping, see the "Understanding XML Mappings" chapter of the Oracle TopLink Developer's Guide.
- See Also:
- Serialized Form
- Since:
- Oracle TopLink 10g Release 2 (10.1.3)
-
-
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.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
Constructors Constructor Description XMLAnyCollectionMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Clone the attribute from the clone and assign it to the backup.voidbuildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)INTERNAL: Clone the attribute from the original and assign it to the clone.voidbuildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: A combination of readFromRowIntoObject and buildClone.protected org.eclipse.persistence.internal.sessions.AbstractRecordbuildCompositeRow(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session, XMLDescriptor referenceDescriptor, org.eclipse.persistence.internal.sessions.AbstractRecord parentRow, org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object originalObject, boolean wasXMLRoot)voidcascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade perform delete through mappings that require the cascadevoidcascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascadejava.lang.Objectclone()INTERNAL: Clones itself.org.eclipse.persistence.internal.sessions.ChangeRecordcompareForChange(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method was created in VisualAge.booleancompareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attributes belonging to this mapping for the objects.java.lang.ObjectconvertDataValueToObjectValue(java.lang.Object fieldValue, Session session, XMLUnmarshaller unmarshaller)INTERNALjava.lang.ObjectconvertObjectValueToDataValue(java.lang.Object value, Session session, XMLMarshaller marshaller)INTERNALvoidfixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: An object has been serialized from the server to the client.org.eclipse.persistence.internal.queries.ContainerPolicygetContainerPolicy()INTERNAL: Return the mapping's containerPolicy.XMLConvertergetConverter()org.eclipse.persistence.internal.helper.DatabaseFieldgetField()INTERNAL: Return the field associated with this mapping if there is exactly one.java.util.VectorgetFields()INTERNAL: Returns a vector of all the fields this mapping represents.booleangetReuseContainer()Return true if the original container on the object should be used if present.AbstractNullPolicygetWrapperNullPolicy()voidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow for initialization of properties and validation.booleanisCollectionMapping()INTERNAL: Related mapping should implement this method to return true.booleanisDefaultEmptyContainer()INTERNAL Return true if an empty container should be set on the object if there is no presence of the collection in the XML document.booleanisMixedContent()booleanisWhitespacePreservedForMixedContent()Setting this to true indicates that text nodes containing *only* whitespaces should still be added to the collection as strings for mixed content.booleanisXMLMapping()INTERNAL: All relational mappings should implement this method to return true.voiditerate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)INTERNAL: Iterate on the appropriate attribute value.voidmergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidmergeIntoObject(java.lang.Object target, boolean isTargetUninitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidsetContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy cp)PUBLIC: Set the mapping's container policy.voidsetConverter(XMLConverter conv)voidsetDefaultEmptyContainer(boolean defaultEmptyContainer)INTERNAL Indicate whether by default an empty container should be set on the field/property if the collection is not present in the XML document.voidsetField(org.eclipse.persistence.internal.helper.DatabaseField field)voidsetMixedContent(boolean mixed)voidsetPreserveWhitespaceForMixedContent(boolean preserveWhitespace)voidsetReuseContainer(boolean reuseContainer)Specify whether the original container on the object should be used if present.voidsetUseXMLRoot(boolean useXMLRoot)voidsetWrapperNullPolicy(AbstractNullPolicy policy)voidsetXPath(java.lang.String xpath)voiduseCollectionClass(java.lang.Class concreteContainerClass)PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.voiduseCollectionClassName(java.lang.String concreteContainerClassName)PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.voiduseListClassName(java.lang.String concreteContainerClassName)PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.voiduseMapClass(java.lang.Class concreteContainerClass, java.lang.String methodName)PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.voiduseMapClassName(java.lang.String concreteContainerClass, java.lang.String methodName)PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.booleanusesXMLRoot()java.lang.ObjectvalueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed)INTERNAL: A subclass should implement this method if it wants different behavior.voidwriteFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: A subclass should implement this method if it wants different behavior.voidwriteSingleValue(java.lang.Object element, java.lang.Object parent, XMLRecord row, 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.XMLAbstractAnyMapping
buildObjectAndWrapInXMLRoot, buildObjectForNonXMLRoot, buildObjectNoReferenceDescriptor, buildXMLRoot, buildXMLRootForText, getDescriptor, getKeepAsElementPolicy, isWriteOnly, preInitialize, setAttributeValueInObject, setIsWriteOnly, setKeepAsElementPolicy
-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildCopy, buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectFields, collectQueryParameters, convertClassNamesToClasses, convertConverterClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDerivedIdMapping, getDescriptor, getFieldClassification, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getReferenceDescriptor, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasNestedIdentityReference, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, instantiateAttribute, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isAttributeValueFromObjectInstantiated, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, 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, remoteInitialization, 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, toString, updateChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
-
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.AnyCollectionMapping
getKeepAsElementPolicy, setIsWriteOnly, setKeepAsElementPolicy
-
Methods inherited from interface org.eclipse.persistence.internal.oxm.mappings.Mapping
getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDescriptor, getReferenceDescriptor, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isReadOnly, isReferenceMapping, isTransformationMapping, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setGetMethodName, setIsReadOnly, setProperties, setSetMethodName
-
Methods inherited from interface org.eclipse.persistence.oxm.mappings.XMLMapping
convertClassNamesToClasses, isWriteOnly, setIsWriteOnly
-
-
-
-
Method Detail
-
buildBackupClone
public void buildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Clone the attribute from the clone and assign it to the backup.- Specified by:
buildBackupClonein classDatabaseMapping
-
buildClone
public void buildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)INTERNAL: Clone the attribute from the original and assign it to the clone.- Specified by:
buildClonein classDatabaseMapping
-
buildCloneFromRow
public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)Description copied from class:DatabaseMappingINTERNAL: A combination of readFromRowIntoObject and buildClone.buildClone assumes the attribute value exists on the original and can simply be copied.
readFromRowIntoObject assumes that one is building an original.
Both of the above assumptions are false in this method, and actually attempts to do both at the same time.
Extract value from the row and set the attribute to this value in the working copy clone. In order to bypass the shared cache when in transaction a UnitOfWork must be able to populate working copies directly from the row.
- Specified by:
buildCloneFromRowin classDatabaseMapping
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade perform delete through mappings that require the cascade- Specified by:
cascadePerformRemoveIfRequiredin classDatabaseMapping
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Specified by:
cascadeRegisterNewIfRequiredin classDatabaseMapping
-
clone
public java.lang.Object clone()
Description copied from class:DatabaseMappingINTERNAL: Clones itself.- Overrides:
clonein classDatabaseMapping
-
compareForChange
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method was created in VisualAge.- Specified by:
compareForChangein classDatabaseMapping- Returns:
- prototype.changeset.ChangeRecord
-
compareObjects
public boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attributes belonging to this mapping for the objects.- Specified by:
compareObjectsin classDatabaseMapping
-
fixObjectReferences
public void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: An object has been serialized from the server to the client. Replace the transient attributes of the remote value holders with client-side objects.- Specified by:
fixObjectReferencesin classDatabaseMapping
-
getContainerPolicy
public org.eclipse.persistence.internal.queries.ContainerPolicy getContainerPolicy()
INTERNAL: Return the mapping's containerPolicy.- Specified by:
getContainerPolicyin interfaceContainerMapping- Specified by:
getContainerPolicyin interfaceorg.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>- Overrides:
getContainerPolicyin classDatabaseMapping
-
getField
public org.eclipse.persistence.internal.helper.DatabaseField getField()
Description copied from class:DatabaseMappingINTERNAL: Return the field associated with this mapping if there is exactly one. This is required for object relational mapping to print them, but because they are defined in in an Enterprise context they cannot be cast to. Mappings that have a field include direct mappings and object relational mappings.- Specified by:
getFieldin interfaceorg.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>- Overrides:
getFieldin classDatabaseMapping
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionDescription copied from class:DatabaseMappingINTERNAL: Allow for initialization of properties and validation.- Overrides:
initializein classDatabaseMapping- Throws:
DescriptorException
-
iterate
public void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
INTERNAL: Iterate on the appropriate attribute value.- Specified by:
iteratein classDatabaseMapping
-
setXPath
public void setXPath(java.lang.String xpath)
-
mergeChangesIntoObject
public void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.- Specified by:
mergeChangesIntoObjectin classDatabaseMapping
-
mergeIntoObject
public void mergeIntoObject(java.lang.Object target, boolean isTargetUninitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.- Specified by:
mergeIntoObjectin classDatabaseMapping
-
setContainerPolicy
public void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy cp)
Description copied from interface:ContainerMappingPUBLIC: Set the mapping's container policy.- Specified by:
setContainerPolicyin interfaceContainerMapping
-
setField
public void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
- Specified by:
setFieldin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
valueFromRow
public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed) throws DatabaseExceptionDescription copied from class:DatabaseMappingINTERNAL: A subclass should implement this method if it wants different behavior. Returns the value for the mapping from the database row. The execution session is the session the query was executed on, and its platform should be used for data conversion.- Overrides:
valueFromRowin classDatabaseMapping- Throws:
DatabaseException
-
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) throws DescriptorExceptionDescription copied from class:DatabaseMappingINTERNAL: A subclass should implement this method if it wants different behavior. Write the attribute value from the object to the row.- Overrides:
writeFromObjectIntoRowin classDatabaseMapping- Throws:
DescriptorException
-
writeSingleValue
public void writeSingleValue(java.lang.Object element, java.lang.Object parent, XMLRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)Description copied from interface:XMLMappingINTERNAL: A method that marshals a single value to the provided Record based on this mapping's XPath. Used for Sequenced marshalling.- Specified by:
writeSingleValuein interfaceorg.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>- Specified by:
writeSingleValuein interfaceXMLMapping- Parameters:
element- - The value to be marshalledrow- - The Record the value is being marshalled too.
-
buildCompositeRow
protected org.eclipse.persistence.internal.sessions.AbstractRecord buildCompositeRow(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session, XMLDescriptor referenceDescriptor, org.eclipse.persistence.internal.sessions.AbstractRecord parentRow, org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object originalObject, boolean wasXMLRoot)
-
isXMLMapping
public boolean isXMLMapping()
Description copied from class:DatabaseMappingINTERNAL: All relational mappings should implement this method to return true.- Overrides:
isXMLMappingin classDatabaseMapping
-
getFields
public java.util.Vector getFields()
Description copied from class:DatabaseMappingINTERNAL: Returns a vector of all the fields this mapping represents.- Overrides:
getFieldsin classDatabaseMapping
-
useCollectionClass
public void useCollectionClass(java.lang.Class concreteContainerClass)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface.
jdk1.1.x: The container class must be a subclass of Vector.
- Specified by:
useCollectionClassin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>- Specified by:
useCollectionClassin interfaceContainerMapping
-
useMapClass
public void useMapClass(java.lang.Class concreteContainerClass, java.lang.String methodName)Description copied from interface:ContainerMappingPUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects. The key used to index a value in theMapis the value returned by a call to the specified zero-argument method. The method must be implemented by the class (or a superclass) of any value to be inserted into theMap.The container class must implement (directly or indirectly) the
java.util.Mapinterface.To facilitate resolving the method, the mapping's referenceClass must set before calling this method.
- Specified by:
useMapClassin interfaceContainerMapping
-
useMapClassName
public void useMapClassName(java.lang.String concreteContainerClass, java.lang.String methodName)Description copied from interface:ContainerMappingPUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects. The key used to index a value in theMapis the value returned by a call to the specified zero-argument method. The method must be implemented by the class (or a superclass) of any value to be inserted into theMap.The container class must implement (directly or indirectly) the
java.util.Mapinterface.To facilitate resolving the method, the mapping's referenceClass must set before calling this method.
- Specified by:
useMapClassNamein interfaceContainerMapping
-
useCollectionClassName
public void useCollectionClassName(java.lang.String concreteContainerClassName)
Description copied from interface:ContainerMappingPUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.The container class must implement (directly or indirectly) the
java.util.Collectioninterface.- Specified by:
useCollectionClassNamein interfaceContainerMapping
-
useListClassName
public void useListClassName(java.lang.String concreteContainerClassName)
Description copied from interface:ContainerMappingPUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.The container class must implement (directly or indirectly) the
java.util.Listinterface.- Specified by:
useListClassNamein interfaceContainerMapping
-
setUseXMLRoot
public void setUseXMLRoot(boolean useXMLRoot)
- Specified by:
setUseXMLRootin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
usesXMLRoot
public boolean usesXMLRoot()
- Specified by:
usesXMLRootin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
isMixedContent
public boolean isMixedContent()
- Specified by:
isMixedContentin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
setMixedContent
public void setMixedContent(boolean mixed)
- Specified by:
setMixedContentin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
isCollectionMapping
public boolean isCollectionMapping()
Description copied from class:DatabaseMappingINTERNAL: Related mapping should implement this method to return true.- Specified by:
isCollectionMappingin interfaceorg.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>- Overrides:
isCollectionMappingin classDatabaseMapping
-
setConverter
public void setConverter(XMLConverter conv)
- Specified by:
setConverterin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
getConverter
public XMLConverter getConverter()
-
isWhitespacePreservedForMixedContent
public boolean isWhitespacePreservedForMixedContent()
Setting this to true indicates that text nodes containing *only* whitespaces should still be added to the collection as strings for mixed content. If mixedContent is false, this setting has no effect.- Specified by:
isWhitespacePreservedForMixedContentin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>- Returns:
-
setPreserveWhitespaceForMixedContent
public void setPreserveWhitespaceForMixedContent(boolean preserveWhitespace)
- Specified by:
setPreserveWhitespaceForMixedContentin interfaceorg.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,XMLConverter,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,Session,UnmarshalKeepAsElementPolicy,XMLUnmarshaller,XMLRecord>
-
getReuseContainer
public boolean getReuseContainer()
Return true if the original container on the object should be used if present. If it is not present then the container policy will be used to create the container.- Specified by:
getReuseContainerin interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping
-
setReuseContainer
public void setReuseContainer(boolean reuseContainer)
Specify whether the original container on the object should be used if present. If it is not present then the container policy will be used to create the container.- Specified by:
setReuseContainerin interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping
-
isDefaultEmptyContainer
public boolean isDefaultEmptyContainer()
INTERNAL Return true if an empty container should be set on the object if there is no presence of the collection in the XML document.- Specified by:
isDefaultEmptyContainerin interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping- Since:
- EclipseLink 2.3.3
-
setDefaultEmptyContainer
public void setDefaultEmptyContainer(boolean defaultEmptyContainer)
INTERNAL Indicate whether by default an empty container should be set on the field/property if the collection is not present in the XML document.- Specified by:
setDefaultEmptyContainerin interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping- Since:
- EclipseLink 2.3.3
-
getWrapperNullPolicy
public AbstractNullPolicy getWrapperNullPolicy()
- Specified by:
getWrapperNullPolicyin interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping
-
setWrapperNullPolicy
public void setWrapperNullPolicy(AbstractNullPolicy policy)
- Specified by:
setWrapperNullPolicyin interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping
-
convertObjectValueToDataValue
public java.lang.Object convertObjectValueToDataValue(java.lang.Object value, Session session, XMLMarshaller marshaller)INTERNAL- Specified by:
convertObjectValueToDataValuein interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLConverterMapping<XMLMarshaller,Session,XMLUnmarshaller>- Since:
- EclipseLink 2.5.0
-
convertDataValueToObjectValue
public java.lang.Object convertDataValueToObjectValue(java.lang.Object fieldValue, Session session, XMLUnmarshaller unmarshaller)INTERNAL- Specified by:
convertDataValueToObjectValuein interfaceorg.eclipse.persistence.internal.oxm.mappings.XMLConverterMapping<XMLMarshaller,Session,XMLUnmarshaller>- Since:
- EclipseLink 2.5.0
-
-