public class NestedTableMapping extends CollectionMapping
Purpose: Nested tables are similar to VARRAYs except internally they store their information in a separate table from their parent structure's table. The advantage of nested tables is that they support querying and joining much better than varrays that are inlined into the parent table. A nested table is typically used to represent a one-to-many or many-to-many relationship of references to another independent structure. TopLink supports storing a nested table of values into a single field.
NOTE: Only Oracle8i supports nested tables type.
DatabaseMapping.WriteTypeINNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER| Constructor and Description |
|---|
NestedTableMapping()
PUBLIC: Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.
|
java.lang.Object |
clone()
INTERNAL: The mapping clones itself to create deep copy
|
org.eclipse.persistence.internal.helper.DatabaseField |
getField()
INTERNAL: Returns the field which this mapping represents.
|
java.lang.String |
getFieldName()
PUBLIC: Return the name of the field this mapping represents.
|
Expression |
getJoinCriteria(org.eclipse.persistence.internal.expressions.ObjectExpression context, Expression base)
INTERNAL: Join criteria is created to read target records (nested table) from the table.
|
java.lang.String |
getStructureName()
PUBLIC: Return the structure name of the nestedTable.
|
boolean |
hasConstraintDependency()
INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.
|
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mapping.
|
boolean |
isNestedTableMapping()
INTERNAL:
|
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Post Initialize the mapping.
|
void |
preDelete(DeleteObjectQuery query)
INTERNAL: Delete privately owned parts
|
void |
preInsert(WriteObjectQuery query)
INTERNAL: Insert privately owned parts
|
void |
preUpdate(WriteObjectQuery query)
INTERNAL: Update the privately owned parts
|
void |
setFieldName(java.lang.String FieldName)
PUBLIC: Set the field name in the mapping.
|
void |
setStructureName(java.lang.String structureName)
PUBLIC: Set the name of the structure.
|
void |
writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord record, 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 |
writeFromObjectIntoRowForShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, org.eclipse.persistence.internal.sessions.AbstractRecord record)
INTERNAL: Write the entire structure into the row as a special type that prints as the constructor.
|
void |
writeFromObjectIntoRowForUpdateAfterShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord record, 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 |
writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values.
|
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildCopy, buildElementClone, buildElementUnitOfWorkClone, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, collectQueryParameters, compareCollectionsForChange, compareForChange, compareObjects, convertClassNamesToClasses, extractResultFromBatchQuery, fixRealObjectReferences, getContainerPolicy, getListOrderField, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getTargetPrimaryKeyFields, hasOrderBy, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, iterateOnElement, iterateOnRealAttributeValue, load, loadAll, mergeChangesIntoObject, mergeIntoObject, mustDeleteReferenceObjectsOneByOne, postCalculateChanges, postDelete, postInsert, recordPrivateOwnedRemovals, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllSQLString, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setSessionName, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, shouldUseListOrderFieldTableExpression, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateChangeRecordForSelfMerge, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, verifyDelete, writeChangesaddForeignKeyField, addTargetForeignKeyField, buildBackupClone, buildClone, buildCloneFromRow, createCloneValueHolder, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinFetch, getMappedBy, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareNestedBatchQuery, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldRefreshCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowaddUnconvertedProperty, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, derivesId, earlyPreDelete, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasInverseConstraintDependency, hasMapsIdValue, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitializeSourceAndTargetExpressions, postUpdate, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRowpublic Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildExpression in class CollectionMappingpublic java.lang.Object clone()
clone in class CollectionMappingpublic org.eclipse.persistence.internal.helper.DatabaseField getField()
getField in class DatabaseMappingpublic java.lang.String getFieldName()
public Expression getJoinCriteria(org.eclipse.persistence.internal.expressions.ObjectExpression context, Expression base)
getJoinCriteria in class CollectionMappingpublic java.lang.String getStructureName()
public boolean hasConstraintDependency()
hasConstraintDependency in class DatabaseMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
initialize in class CollectionMappingDescriptorExceptionpublic boolean isNestedTableMapping()
isNestedTableMapping in class DatabaseMapping
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
postInitialize in class CollectionMappingDescriptorExceptionpublic void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionpublic void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preInsert in class CollectionMappingDatabaseExceptionOptimisticLockExceptionpublic void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preUpdate in class CollectionMappingDatabaseExceptionOptimisticLockExceptionpublic void setFieldName(java.lang.String FieldName)
public void setStructureName(java.lang.String structureName)
public void writeFromObjectIntoRow(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMapping
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsert in class DatabaseMapping
public void writeFromObjectIntoRowForUpdateAfterShallowInsert(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.helper.DatabaseTable table)
writeFromObjectIntoRowForUpdateAfterShallowInsert in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsertWithChangeRecord in class DatabaseMappingpublic void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, org.eclipse.persistence.internal.sessions.AbstractRecord record) throws DescriptorException
writeFromObjectIntoRowForUpdate in class DatabaseMappingDescriptorException
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeInsertFieldsIntoRow in class DatabaseMapping