public class XMLCollectionReferenceMapping extends XMLObjectReferenceMapping implements CollectionReferenceMapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,UnmarshalRecord,XMLField,XMLRecord>, ContainerMapping
XMLObjectReferenceMapping,
ContainerMapping,
Serialized FormDatabaseMapping.WriteTypeEMPTY_CONTAINER_DEFAULT| Constructor and Description |
|---|
XMLCollectionReferenceMapping()
PUBLIC:
The default constructor initializes the sourceToTargetKeyFieldAssociations
and sourceToTargetKeys data structures.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
buildFieldValue(java.lang.Object targetObject,
XMLField xmlFld,
AbstractSession session)
INTERNAL:
Retrieve the target object's primary key value that is mapped to a given
source xpath (in the source-target key field association list).
|
void |
buildReference(java.lang.Object srcObject,
XMLField xmlField,
java.lang.Object object,
AbstractSession session,
java.lang.Object container,
ReferenceResolver resolver)
INTERNAL:
Create (if necessary) and populate a reference object that will be used
during the mapping reference resolution phase after unmarshalling is
complete.
|
void |
buildReference(UnmarshalRecord record,
XMLField xmlField,
java.lang.Object object,
AbstractSession session,
java.lang.Object container)
INTERNAL:
Create (if necessary) and populate a reference object that will be used
during the mapping reference resolution phase after unmarshalling is
complete.
|
ContainerPolicy |
getContainerPolicy()
INTERNAL:
Return the mapping's containerPolicy.
|
DatabaseField |
getField()
INTERNAL:
Return the field associated with this mapping if there is exactly one.
|
boolean |
getReuseContainer()
Return true if the original container on the object should be used if
present.
|
AbstractNullPolicy |
getWrapperNullPolicy()
Get the Wrapper NullPolicy from the Mapping.
|
java.lang.String |
getXPath()
Get the XPath String
|
void |
initialize(AbstractSession session)
INTERNAL:
The mapping is initialized with the given session.
|
boolean |
isCollectionMapping()
INTERNAL:
Related mapping should implement this method to return true.
|
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.
|
java.lang.Object |
readFromRowIntoObject(AbstractRecord databaseRow,
JoinedAttributeManager joinManager,
java.lang.Object targetObject,
CacheKey parentCacheKey,
ObjectBuildingQuery sourceQuery,
AbstractSession executionSession,
boolean isTargetProtected)
INTERNAL:
Extract the primary key values from the row, then create an
org.eclipse.persistence.internal.oxm.Reference instance and stored it
on the session's org.eclipse.persistence.internal.oxm.ReferenceResolver.
|
java.lang.Object |
readFromRowIntoObject(AbstractRecord databaseRow,
JoinedAttributeManager joinManager,
java.lang.Object targetObject,
CacheKey parentCacheKey,
ObjectBuildingQuery sourceQuery,
AbstractSession executionSession,
boolean isTargetProtected,
java.lang.Object container)
INTERNAL:
Extract the primary key values from the row, then create an
org.eclipse.persistence.internal.oxm.Reference instance and stored it
on the session's org.eclipse.persistence.internal.oxm.ReferenceResolver.
|
void |
setContainerPolicy(ContainerPolicy containerPolicy)
ADVANCED:
Set the mapping's containerPolicy.
|
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.
|
void |
setField(DatabaseField field) |
void |
setReuseContainer(boolean reuseContainer)
Specify whether the original container on the object should be used if
present.
|
void |
setUsesSingleNode(boolean useSingleNode) |
void |
setWrapperNullPolicy(AbstractNullPolicy policy)
Set the Wrapper NullPolicy on the Mapping.
|
void |
setXPath(java.lang.String xpathString)
Set the Mapping field name attribute to the given XPath String
|
void |
useCollectionClass(java.lang.Class concreteContainerClass)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
void |
useCollectionClassName(java.lang.String concreteContainerClassName)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
void |
useListClassName(java.lang.String concreteContainerClassName)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
void |
useMapClass(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.
|
void |
useMapClassName(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.
|
boolean |
usesSingleNode()
INTERNAL:
For the purpose of XMLCollectionReferenceMappings, 'usesSingleNode'
refers to the fact that the source key xpath fields should all be written as
space-separated lists.
|
void |
writeFromObjectIntoRow(java.lang.Object object,
AbstractRecord row,
AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL:
Write the attribute value from the object to the row.
|
void |
writeSingleValue(java.lang.Object value,
java.lang.Object parent,
XMLRecord row,
AbstractSession session)
INTERNAL:
A method that marshals a single value to the provided Record based on this mapping's
XPath.
|
addSourceToTargetKeyFieldAssociation, addSourceToTargetKeyFieldAssociation, buildReference, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, getFields, getInverseReferenceMapping, getSourceToTargetKeyFieldAssociations, isObjectReferenceMapping, isWriteOnly, isXMLMapping, preInitialize, setAttributeValueInObject, setIsWriteOnly, setSourceToTargetKeyFieldAssociationsbuildBackupClone, buildClone, buildCloneFromRow, buildCopy, buildExpression, compareForChange, compareObjects, convertClassNamesToClasses, fixObjectReferences, getReferenceClass, getReferenceClassName, getReferenceDescriptor, hasNestedIdentityReference, isAggregateMapping, iterate, load, loadAll, mergeChangesIntoObject, mergeIntoObject, postDelete, postDeleteAttributeValue, postInsert, postInsertAttributeValue, postUpdate, postUpdateAttributeValue, preDelete, preDeleteAttributeValue, preInsert, preInsertAttributeValue, preUpdate, preUpdateAttributeValue, remoteInitialization, setReferenceClass, setReferenceClassName, updateChangeRecord, verifyDeleteaddUnconvertedProperty, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, clone, collectQueryParameters, createCloneValueHolder, derivesId, earlyPreDelete, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDerivedIdMapping, getDescriptor, getFieldClassification, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasUnconvertedProperties, instantiateAttribute, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, 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, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postInitialize, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsCacheable, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRowequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSourceToTargetKeyFieldAssociation, buildReference, getFields, getInverseReferenceMapping, getReferenceClass, getReferenceClassName, getSourceToTargetKeyFieldAssociations, isWriteOnly, setIsWriteOnly, setReferenceClassNameconvertClassNamesToClasses, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDescriptor, getReferenceDescriptor, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isReadOnly, isReferenceMapping, isTransformationMapping, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setGetMethodName, setIsReadOnly, setProperties, setSetMethodNameconvertClassNamesToClassespublic XMLCollectionReferenceMapping()
public DatabaseField getField()
DatabaseMappinggetField in interface Mapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,XMLRecord>getField in class DatabaseMappingpublic void setField(DatabaseField field)
setField in class XMLObjectReferenceMappingpublic java.lang.String getXPath()
public void setXPath(java.lang.String xpathString)
xpathString - Stringpublic java.lang.Object buildFieldValue(java.lang.Object targetObject,
XMLField xmlFld,
AbstractSession session)
buildFieldValue in interface ObjectReferenceMapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,UnmarshalRecord,XMLField,XMLRecord>buildFieldValue in class XMLObjectReferenceMappingtargetObject - - the reference class instance that holds the required pk valuexmlFld - session - public void buildReference(UnmarshalRecord record, XMLField xmlField, java.lang.Object object, AbstractSession session, java.lang.Object container)
buildReference in interface CollectionReferenceMapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,UnmarshalRecord,XMLField,XMLRecord>public void buildReference(java.lang.Object srcObject,
XMLField xmlField,
java.lang.Object object,
AbstractSession session,
java.lang.Object container,
ReferenceResolver resolver)
public ContainerPolicy getContainerPolicy()
getContainerPolicy in interface Mapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,XMLRecord>getContainerPolicy in interface ContainerMappinggetContainerPolicy in class DatabaseMappingpublic void initialize(AbstractSession session) throws DescriptorException
initialize in class XMLObjectReferenceMappingDescriptorExceptionReferenceResolver,
NamespaceResolverpublic java.lang.Object readFromRowIntoObject(AbstractRecord databaseRow, JoinedAttributeManager joinManager, java.lang.Object targetObject, CacheKey parentCacheKey, ObjectBuildingQuery sourceQuery, AbstractSession executionSession, boolean isTargetProtected) throws DatabaseException
readFromRowIntoObject in class XMLObjectReferenceMappingDatabaseExceptionpublic java.lang.Object readFromRowIntoObject(AbstractRecord databaseRow, JoinedAttributeManager joinManager, java.lang.Object targetObject, CacheKey parentCacheKey, ObjectBuildingQuery sourceQuery, AbstractSession executionSession, boolean isTargetProtected, java.lang.Object container) throws DatabaseException
DatabaseExceptionpublic void setContainerPolicy(ContainerPolicy containerPolicy)
setContainerPolicy in interface ContainerMappingpublic void useCollectionClass(java.lang.Class concreteContainerClass)
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.
useCollectionClass in interface ContainerMappingpublic void useCollectionClassName(java.lang.String concreteContainerClassName)
ContainerMappingThe container class must implement (directly or indirectly) the
java.util.Collection interface.
useCollectionClassName in interface CollectionReferenceMapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,UnmarshalRecord,XMLField,XMLRecord>useCollectionClassName in interface ContainerMappingpublic void useListClassName(java.lang.String concreteContainerClassName)
ContainerMappingThe container class must implement (directly or indirectly) the
java.util.List interface.
useListClassName in interface ContainerMappingpublic void useMapClass(java.lang.Class concreteContainerClass,
java.lang.String methodName)
jdk1.2.x: The container class must implement (directly or indirectly) the Map interface.
jdk1.1.x: The container class must be a subclass of Hashtable.
The referenceClass must be set before calling this method.
useMapClass in interface ContainerMappingpublic void useMapClassName(java.lang.String concreteContainerClass,
java.lang.String methodName)
jdk1.2.x: The container class must implement (directly or indirectly) the Map interface.
jdk1.1.x: The container class must be a subclass of Hashtable.
The referenceClass must be set before calling this method.
useMapClassName in interface ContainerMappingpublic boolean usesSingleNode()
usesSingleNode in interface CollectionReferenceMapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,UnmarshalRecord,XMLField,XMLRecord>public void setUsesSingleNode(boolean useSingleNode)
public void writeFromObjectIntoRow(java.lang.Object object,
AbstractRecord row,
AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class XMLObjectReferenceMappingpublic void writeSingleValue(java.lang.Object value,
java.lang.Object parent,
XMLRecord row,
AbstractSession session)
XMLMappingwriteSingleValue in interface Mapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,XMLRecord>writeSingleValue in interface XMLMappingwriteSingleValue in class XMLObjectReferenceMappingvalue - - The value to be marshalledrow - - The Record the value is being marshalled too.public boolean isCollectionMapping()
DatabaseMappingisCollectionMapping in interface Mapping<AbstractSession,AttributeAccessor,ContainerPolicy,ClassDescriptor,DatabaseField,XMLRecord>isCollectionMapping in class DatabaseMappingpublic boolean getReuseContainer()
getReuseContainer in interface XMLContainerMappingpublic void setReuseContainer(boolean reuseContainer)
setReuseContainer in interface XMLContainerMappingpublic boolean isDefaultEmptyContainer()
isDefaultEmptyContainer in interface XMLContainerMappingpublic void setDefaultEmptyContainer(boolean defaultEmptyContainer)
setDefaultEmptyContainer in interface XMLContainerMappingpublic AbstractNullPolicy getWrapperNullPolicy()
XMLContainerMappinggetWrapperNullPolicy in interface XMLContainerMappingpublic void setWrapperNullPolicy(AbstractNullPolicy policy)
XMLContainerMappingsetWrapperNullPolicy in interface XMLContainerMappingEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference