org.eclipse.persistence.mappings.structures
Class ObjectRelationalDataTypeDescriptor
java.lang.Object
org.eclipse.persistence.descriptors.ClassDescriptor
org.eclipse.persistence.descriptors.RelationalDescriptor
org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class ObjectRelationalDataTypeDescriptor
- extends RelationalDescriptor
Purpose:
Differentiates object-relational descriptors from normal relational descriptors.
The object-relational descriptor describes a type not a table, (although there
is normally a table associated with the type, unless it is aggregate).
- See Also:
- Serialized Form
Fields inherited from class org.eclipse.persistence.descriptors.ClassDescriptor |
additionalTablePrimaryKeyFields, AGGREGATE, AGGREGATE_COLLECTION, alias, allFields, amendmentClass, amendmentClassName, amendmentMethodName, cacheInterceptorClass, cacheInterceptorClassName, cacheInvalidationPolicy, cacheSynchronizationType, cascadeLockingPolicies, changePolicy, cmpPolicy, constraintDependencies, copyPolicy, copyPolicyClassName, defaultDeleteObjectQueryRedirector, defaultDeleteObjectQueryRedirectorClassName, defaultInsertObjectQueryRedirector, defaultInsertObjectQueryRedirectorClassName, defaultQueryRedirector, defaultQueryRedirectorClassName, defaultReadAllQueryRedirector, defaultReadAllQueryRedirectorClassName, defaultReadObjectQueryRedirector, defaultReadObjectQueryRedirectorClassName, defaultReportQueryRedirector, defaultReportQueryRedirectorClassName, defaultTable, defaultUpdateObjectQueryRedirector, defaultUpdateObjectQueryRedirectorClassName, descriptorType, DO_NOT_SEND_CHANGES, ERROR, eventManager, fetchGroupManager, fields, hasSimplePrimaryKey, historyPolicy, identityMapClass, identityMapSize, idValidation, inheritancePolicy, initializationStage, INITIALIZED, instantiationPolicy, INTERFACE, interfaceInitializationStage, interfacePolicy, INVALIDATE_CHANGED_OBJECTS, isIsolated, isNativeConnectionRequired, ISOLATE_CACHE_AFTER_TRANSACTION, ISOLATE_CACHE_ALWAYS, ISOLATE_NEW_DATA_AFTER_TRANSACTION, javaClass, javaClassName, lockableMappings, mappings, multipleTableForeignKeys, multipleTableInsertOrder, NORMAL, objectBuilder, optimisticLockingPolicy, POST_INITIALIZED, PREINITIALIZED, primaryKeyFields, properties, queryKeys, queryManager, remoteIdentityMapClass, remoteIdentityMapSize, returningPolicy, SEND_NEW_OBJECTS_WITH_CHANGES, SEND_OBJECT_CHANGES, sequenceNumberField, sequenceNumberName, sessionName, shouldAcquireCascadedLocks, shouldAlwaysConformResultsInUnitOfWork, shouldAlwaysRefreshCache, shouldAlwaysRefreshCacheOnRemote, shouldBeReadOnly, shouldDisableCacheHits, shouldDisableCacheHitsOnRemote, shouldOnlyRefreshCacheIfNewerVersion, shouldOrderMappings, shouldRegisterResultsInUnitOfWork, tables, UNDEFINED_ISOLATATION, UNDEFINED_OBJECT_CHANGE_BEHAVIOR, UNINITIALIZED, unitOfWorkCacheIsolationLevel, USE_SESSION_CACHE_AFTER_TRANSACTION, wrapperPolicy |
Method Summary |
void |
addFieldOrdering(java.lang.String fieldName)
PUBLIC:
Order the fields in a specific
Add the field ordering, this will order the fields in the order this method is called. |
static java.lang.Object |
buildArrayObjectFromArray(java.lang.Object array)
INTERNAL:
Build array of objects for Array data type. |
static java.lang.Object |
buildArrayObjectFromStruct(java.lang.Object structure)
INTERNAL:
Build array of objects for Struct data type. |
static java.lang.Object |
buildContainerFromArray(java.sql.Array fieldValue,
ObjectRelationalDatabaseField arrayField,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the nested rows from the specified field value. |
java.util.Vector |
buildDirectValuesFromFieldValue(java.lang.Object fieldValue)
INTERNAL:
Extract the direct values from the specified field value. |
java.lang.Object |
buildFieldValueFromDirectValues(java.util.Vector directValues,
java.lang.String elementDataTypeName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build the appropriate field value for the specified
set of direct values. |
java.lang.Object |
buildFieldValueFromNestedRow(org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the field value from the specified nested database row. |
java.lang.Object |
buildFieldValueFromNestedRows(java.util.Vector nestedRows,
java.lang.String structureName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the appropriate field value for the specified
set of nested rows. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildNestedRowFromFieldValue(java.lang.Object fieldValue)
INTERNAL:
Build and return the nested database row from the specified field value. |
java.util.Vector |
buildNestedRowsFromFieldValue(java.lang.Object fieldValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the nested rows from the specified field value. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildRowFromStructure(java.sql.Struct structure)
INTERNAL:
Build a row representation from the ADT structure field array. |
java.sql.Struct |
buildStructureFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
java.sql.Connection connection)
INTERNAL:
Build a ADT structure from the row data. |
protected org.eclipse.persistence.internal.helper.DatabaseTable |
extractDefaultTable()
INTERNAL:
Aggregates use a dummy table as default. |
java.util.Vector |
getOrderedFields()
INTERNAL:
Return the field order. |
java.sql.Ref |
getRef(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Get the ref for the object. |
java.lang.String |
getStructureName()
PUBLIC:
Return the name of the structure. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Auto-Default orderedFields to fields |
boolean |
isObjectRelationalDataTypeDescriptor()
PUBLIC:
Return if this is an ObjectRelationalDataTypeDescriptor. |
boolean |
requiresInitialization()
INTERNAL:
Aggregates obj-rel are initialized normally as no cloning is required. |
void |
setOrderedFields(java.util.Vector orderedFields)
INTERNAL:
Set the field order. |
void |
setStructureName(java.lang.String structureName)
PUBLIC:
Set the name of the structure. |
protected void |
validateMappingType(DatabaseMapping mapping)
|
Methods inherited from class org.eclipse.persistence.descriptors.ClassDescriptor |
addAbstractQueryKey, addCascadeLockingPolicy, addConstraintDependencies, addConstraintDependency, addDirectMapping, addDirectMapping, addDirectQueryKey, addForeignKeyFieldForMultipleTable, addForeignKeyFieldNameForMultipleTable, addMapping, addPrimaryKeyField, addPrimaryKeyFieldName, addQueryKey, addTable, adjustMultipleTableInsertOrder, alwaysConformResultsInUnitOfWork, alwaysRefreshCache, alwaysRefreshCacheOnRemote, applyAmendmentMethod, applyAmendmentMethod, arePrimaryKeyFields, buildCallFromStatement, buildField, buildField, buildFieldValueFromForeignKeys, checkDatabase, checkInheritanceTreeAggregateSettings, checkMultipleTableForeignKeys, clone, convertClassNamesToClasses, createCopyPolicy, createInstantiationPolicy, descriptorIsAggregate, descriptorIsAggregateCollection, descriptorIsForInterface, descriptorIsNormal, disableCacheHits, disableCacheHitsOnRemote, dontAlwaysConformResultsInUnitOfWork, dontAlwaysRefreshCache, dontAlwaysRefreshCacheOnRemote, dontDisableCacheHits, dontDisableCacheHitsOnRemote, dontOnlyRefreshCacheIfNewerVersion, getAdditionalTablePrimaryKeyFields, getAlias, getAllFields, getAmendmentClass, getAmendmentClassName, getAmendmentMethodName, getCacheInterceptorClass, getCacheInterceptorClassName, getCacheInvalidationPolicy, getCacheSynchronizationType, getCascadeLockingPolicies, getCMPPolicy, getConstraintDependencies, getCopyPolicy, getCopyPolicyClassName, getDefaultDeleteObjectQueryRedirector, getDefaultFetchGroup, getDefaultInsertObjectQueryRedirector, getDefaultQueryRedirector, getDefaultReadAllQueryRedirector, getDefaultReadObjectQueryRedirector, getDefaultReportQueryRedirector, getDefaultTable, getDefaultUpdateObjectQueryRedirector, getDescriptorEventManager, getDescriptorInheritancePolicy, getDescriptorQueryManager, getDescriptorType, getDescriptorTypeValue, getEventManager, getFetchGroupManager, getFields, getHistoryPolicy, getIdentityMapClass, getIdentityMapSize, getIdValidation, getInheritancePolicy, getInheritancePolicyOrNull, getInstantiationPolicy, getInterfacePolicy, getInterfacePolicyOrNull, getJavaClass, getJavaClassName, getLockableMappings, getMappingForAttributeName, getMappings, getMultipleTableForeignKeyAssociations, getMultipleTableForeignKeys, getMultipleTableInsertOrder, getMultipleTablePrimaryKeyAssociations, getObjectBuilder, getObjectChangePolicy, getObjectChangePolicyInternal, getOptimisticLockingPolicy, getPrimaryKeyFieldNames, getPrimaryKeyFields, getProperties, getProperty, getQueryKeyNamed, getQueryKeys, getQueryManager, getRemoteIdentityMapClass, getRemoteIdentityMapSize, getReturningPolicy, getRootDescriptor, getSequenceNumberField, getSequenceNumberFieldName, getSequenceNumberName, getSessionName, getTable, getTables, getTypedField, getUnitOfWorkCacheIsolationLevel, getWrapperPolicy, hasCascadeLockingPolicies, hasCMPPolicy, hasDependencyOnParts, hasFetchGroupManager, hasInheritance, hasInterfacePolicy, hasMultipleTables, hasPessimisticLockingPolicy, hasPrivatelyOwnedParts, hasQueryKeyOrMapping, hasReturningPolicy, hasSimplePrimaryKey, hasWrapperPolicy, initializeAggregateInheritancePolicy, initializeMultipleTablePrimaryKeyFields, initializeProperties, interfaceInitialization, isAggregateCollectionDescriptor, isAggregateDescriptor, isChildDescriptor, isDescriptorForCMP, isDescriptorForInterface, isFullyInitialized, isInitialized, isInterfaceChildDescriptor, isInterfaceInitialized, isInvalid, isIsolated, isMultipleTableDescriptor, isNativeConnectionRequired, isPrimaryKeySetAfterInsert, isReturnTypeRequiredForReturningPolicy, onlyRefreshCacheIfNewerVersion, postInitialize, preInitialize, preInitializeInheritancePolicy, preInterfaceInitialization, prepareCascadeLockingPolicy, rehashFieldDependancies, reInitializeJoinedAttributes, remoteInitialization, removeMappingForAttributeName, removeProperty, selfValidationAfterInitialization, selfValidationBeforeInitialization, setAdditionalTablePrimaryKeyFields, setAdditionalTablePrimaryKeyFields, setAlias, setAllFields, setAmendmentClass, setAmendmentClassName, setAmendmentMethodName, setCacheInterceptorClass, setCacheInterceptorClassName, setCacheInvalidationPolicy, setCacheSynchronizationType, setCMPPolicy, setConstraintDependencies, setCopyPolicy, setCopyPolicyClassName, setDefaultDeleteObjectQueryRedirector, setDefaultDeleteObjectQueryRedirectorClassName, setDefaultInsertObjectQueryRedirector, setDefaultInsertObjectQueryRedirectorClassName, setDefaultQueryRedirector, setDefaultQueryRedirectorClassName, setDefaultReadAllQueryRedirector, setDefaultReadAllQueryRedirectorClassName, setDefaultReadObjectQueryRedirector, setDefaultReadObjectQueryRedirectorClassName, setDefaultReportQueryRedirector, setDefaultReportQueryRedirectorClassName, setDefaultTable, setDefaultUpdateObjectQueryRedirector, setDefaultUpdateObjectQueryRedirectorClassName, setDescriptorType, setDescriptorTypeValue, setEventManager, setExistenceChecking, setFetchGroupManager, setFields, setForeignKeyFieldNamesForMultipleTable, setHasSimplePrimaryKey, setHistoryPolicy, setIdentityMapClass, setIdentityMapSize, setIdValidation, setInheritancePolicy, setInitializationStage, setInstantiationPolicy, setInterfaceInitializationStage, setInterfacePolicy, setInternalDefaultTable, setInternalDefaultTable, setIsIsolated, setIsNativeConnectionRequired, setJavaClass, setJavaClassName, setJavaInterface, setJavaInterfaceName, setLockableMappings, setMappings, setMultipleTableForeignKeys, setMultipleTableInsertOrder, setObjectBuilder, setObjectChangePolicy, setOptimisticLockingPolicy, setPrimaryKeyFieldName, setPrimaryKeyFieldNames, setPrimaryKeyFields, setProperties, setProperty, setQueryKeys, setQueryManager, setReadOnly, setRemoteIdentityMapClass, setRemoteIdentityMapSize, setReturningPolicy, setSequenceNumberField, setSequenceNumberFieldName, setSequenceNumberName, setSessionName, setShouldAcquireCascadedLocks, setShouldAlwaysConformResultsInUnitOfWork, setShouldAlwaysRefreshCache, setShouldAlwaysRefreshCacheOnRemote, setShouldBeReadOnly, setShouldDisableCacheHits, setShouldDisableCacheHitsOnRemote, setShouldOnlyRefreshCacheIfNewerVersion, setShouldOrderMappings, setShouldRegisterResultsInUnitOfWork, setTables, setUnitOfWorkCacheIsolationLevel, setWrapperPolicy, shouldAcquireCascadedLocks, shouldAlwaysConformResultsInUnitOfWork, shouldAlwaysRefreshCache, shouldAlwaysRefreshCacheOnRemote, shouldBeReadOnly, shouldDisableCacheHits, shouldDisableCacheHitsOnRemote, shouldIsolateObjectsInUnitOfWork, shouldIsolateObjectsInUnitOfWorkEarlyTransaction, shouldOnlyRefreshCacheIfNewerVersion, shouldOrderMappings, shouldRegisterResultsInUnitOfWork, shouldUseCacheIdentityMap, shouldUseFullIdentityMap, shouldUseHardCacheWeakIdentityMap, shouldUseNoIdentityMap, shouldUseRemoteCacheIdentityMap, shouldUseRemoteFullIdentityMap, shouldUseRemoteHardCacheWeakIdentityMap, shouldUseRemoteNoIdentityMap, shouldUseRemoteSoftCacheWeakIdentityMap, shouldUseRemoteSoftIdentityMap, shouldUseRemoteWeakIdentityMap, shouldUseSessionCacheInUnitOfWorkEarlyTransaction, shouldUseSoftCacheWeakIdentityMap, shouldUseSoftIdentityMap, shouldUseWeakIdentityMap, supportsChangeTracking, toggleAdditionalTablePrimaryKeyFields, toString, useAllFieldsLocking, useCacheIdentityMap, useChangedFieldsLocking, useCloneCopyPolicy, useCloneCopyPolicy, useDefaultConstructorInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFullIdentityMap, useHardCacheWeakIdentityMap, useInstantiationCopyPolicy, useMethodInstantiationPolicy, useNoIdentityMap, useRemoteCacheIdentityMap, useRemoteFullIdentityMap, useRemoteHardCacheWeakIdentityMap, useRemoteNoIdentityMap, useRemoteSoftCacheWeakIdentityMap, useRemoteSoftIdentityMap, useRemoteWeakIdentityMap, useSelectedFieldsLocking, usesFieldLocking, useSoftCacheWeakIdentityMap, useSoftIdentityMap, usesOptimisticLocking, usesSequenceNumbers, usesVersionLocking, useTimestampLocking, useTimestampLocking, useVersionLocking, useVersionLocking, useWeakIdentityMap, validateAfterInitialization, validateBeforeInitialization, verifyTableQualifiers |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
structureName
protected java.lang.String structureName
orderedFields
protected java.util.Vector orderedFields
ObjectRelationalDataTypeDescriptor
public ObjectRelationalDataTypeDescriptor()
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
- INTERNAL:
Auto-Default orderedFields to fields
- Overrides:
initialize
in class ClassDescriptor
- Throws:
DescriptorException
addFieldOrdering
public void addFieldOrdering(java.lang.String fieldName)
- PUBLIC:
Order the fields in a specific
Add the field ordering, this will order the fields in the order this method is called.
- Parameters:
fieldName
- the name of the field to add ordering on.
buildDirectValuesFromFieldValue
public java.util.Vector buildDirectValuesFromFieldValue(java.lang.Object fieldValue)
throws DatabaseException
- INTERNAL:
Extract the direct values from the specified field value.
Return them in a vector.
The field value better be an Array.
- Overrides:
buildDirectValuesFromFieldValue
in class ClassDescriptor
- Throws:
DatabaseException
buildFieldValueFromDirectValues
public java.lang.Object buildFieldValueFromDirectValues(java.util.Vector directValues,
java.lang.String elementDataTypeName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DatabaseException
- INTERNAL:
Build the appropriate field value for the specified
set of direct values.
The database better be expecting an ARRAY.
- Overrides:
buildFieldValueFromDirectValues
in class ClassDescriptor
- Throws:
DatabaseException
buildFieldValueFromNestedRow
public java.lang.Object buildFieldValueFromNestedRow(org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DatabaseException
- INTERNAL:
Build and return the field value from the specified nested database row.
The database better be expecting a Struct.
- Overrides:
buildFieldValueFromNestedRow
in class ClassDescriptor
- Throws:
DatabaseException
buildFieldValueFromNestedRows
public java.lang.Object buildFieldValueFromNestedRows(java.util.Vector nestedRows,
java.lang.String structureName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DatabaseException
- INTERNAL:
Build and return the appropriate field value for the specified
set of nested rows.
The database better be expecting an ARRAY.
It looks like we can ignore inheritance here....
- Overrides:
buildFieldValueFromNestedRows
in class ClassDescriptor
- Throws:
DatabaseException
buildContainerFromArray
public static java.lang.Object buildContainerFromArray(java.sql.Array fieldValue,
ObjectRelationalDatabaseField arrayField,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DatabaseException
- INTERNAL:
Build and return the nested rows from the specified field value.
This method allows the field value to be an ARRAY containing other structures
such as arrays or Struct, or direct values.
- Throws:
DatabaseException
buildNestedRowFromFieldValue
public org.eclipse.persistence.internal.sessions.AbstractRecord buildNestedRowFromFieldValue(java.lang.Object fieldValue)
throws DatabaseException
- INTERNAL:
Build and return the nested database row from the specified field value.
The field value better be an Struct.
- Overrides:
buildNestedRowFromFieldValue
in class ClassDescriptor
- Throws:
DatabaseException
buildNestedRowsFromFieldValue
public java.util.Vector buildNestedRowsFromFieldValue(java.lang.Object fieldValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DatabaseException
- INTERNAL:
Build and return the nested rows from the specified field value.
The field value better be an ARRAY.
- Overrides:
buildNestedRowsFromFieldValue
in class ClassDescriptor
- Throws:
DatabaseException
buildRowFromStructure
public org.eclipse.persistence.internal.sessions.AbstractRecord buildRowFromStructure(java.sql.Struct structure)
throws DatabaseException
- INTERNAL:
Build a row representation from the ADT structure field array.
TopLink will then build the object from the row.
- Throws:
DatabaseException
buildStructureFromRow
public java.sql.Struct buildStructureFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
java.sql.Connection connection)
throws DatabaseException
- INTERNAL:
Build a ADT structure from the row data.
- Throws:
DatabaseException
buildArrayObjectFromArray
public static java.lang.Object buildArrayObjectFromArray(java.lang.Object array)
throws DatabaseException
- INTERNAL:
Build array of objects for Array data type.
- Throws:
DatabaseException
buildArrayObjectFromStruct
public static java.lang.Object buildArrayObjectFromStruct(java.lang.Object structure)
throws DatabaseException
- INTERNAL:
Build array of objects for Struct data type.
- Throws:
DatabaseException
extractDefaultTable
protected org.eclipse.persistence.internal.helper.DatabaseTable extractDefaultTable()
- INTERNAL:
Aggregates use a dummy table as default.
- Overrides:
extractDefaultTable
in class ClassDescriptor
getOrderedFields
public java.util.Vector getOrderedFields()
- INTERNAL:
Return the field order.
getRef
public java.sql.Ref getRef(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
- INTERNAL:
Get the ref for the object.
This is required for use by Refs, there might be a better way to do it when objID are supported.
(i.e. getting it from the object or identity map).
getStructureName
public java.lang.String getStructureName()
- PUBLIC:
Return the name of the structure.
This is the name of the user defined data type as defined on the database.
isObjectRelationalDataTypeDescriptor
public boolean isObjectRelationalDataTypeDescriptor()
- PUBLIC:
Return if this is an ObjectRelationalDataTypeDescriptor.
- Overrides:
isObjectRelationalDataTypeDescriptor
in class ClassDescriptor
requiresInitialization
public boolean requiresInitialization()
- INTERNAL:
Aggregates obj-rel are initialized normally as no cloning is required.
- Overrides:
requiresInitialization
in class ClassDescriptor
validateMappingType
protected void validateMappingType(DatabaseMapping mapping)
- Overrides:
validateMappingType
in class ClassDescriptor
setOrderedFields
public void setOrderedFields(java.util.Vector orderedFields)
- INTERNAL:
Set the field order.
setStructureName
public void setStructureName(java.lang.String structureName)
- PUBLIC:
Set the name of the structure.
This is the name of the user defined data type as defined on the database.