Class RelationalDescriptor
- java.lang.Object
-
- org.eclipse.persistence.core.descriptors.CoreDescriptor<AttributeGroup,DescriptorEventManager,org.eclipse.persistence.internal.helper.DatabaseField,InheritancePolicy,org.eclipse.persistence.internal.descriptors.InstantiationPolicy,java.util.Vector,org.eclipse.persistence.internal.descriptors.ObjectBuilder>
-
- org.eclipse.persistence.descriptors.ClassDescriptor
-
- org.eclipse.persistence.descriptors.RelationalDescriptor
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
ObjectRelationalDataTypeDescriptor
public class RelationalDescriptor extends ClassDescriptor
Purpose: EclipseLink has been designed to take advantage of the similarities between relational databases and objects while accommodating for their differences, providing an object oriented wrapper for relational databases. This is accomplished through the use of Descriptors. A descriptor is a pure specification class with all its behavior deputized to DescriptorEventManager, DescriptorQueryManager and ObjectBuilder. Look at the following variables for the list of specification on the descriptor.
A Descriptor is a set of mappings that describe how an objects's data is to be represented in a relational database. It contains mappings from the class instance variables to the table's fields, as well as the transformation routines necessary for storing and retrieving attributes. As such the descriptor acts as the link between the Java object and its database representation.
Every descriptor is initialized with the following information:
- The Java class its describes, and the corresponding table(s) for storing instances of the class.
- The primary key of the table.
- A list of query keys for field names.
- A description of the objects's attributes and relationships. This information is stored in mappings.
- A set of user selectable properties for tailoring the behavior of the descriptor.
This descriptor subclass should be used for object-relational mapping, and allows for other datatype mappings to be done in the XML, EIS and OR sibling classes.
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.descriptors.ClassDescriptor
accessorTree, additionalAggregateCollectionKeyFields, additionalTablePrimaryKeyFields, additionalWritableMapKeyFields, AGGREGATE, AGGREGATE_COLLECTION, alias, allFields, allSelectionFields, amendmentClass, amendmentClassName, amendmentMethodName, cacheInvalidationPolicy, cachePolicy, cascadedLockingInitialized, cascadeLockingPolicies, changePolicy, cmpPolicy, constraintDependencies, copyPolicy, copyPolicyClassName, defaultDeleteObjectQueryRedirector, defaultDeleteObjectQueryRedirectorClassName, defaultInsertObjectQueryRedirector, defaultInsertObjectQueryRedirectorClassName, defaultQueryRedirector, defaultQueryRedirectorClassName, defaultReadAllQueryRedirector, defaultReadAllQueryRedirectorClassName, defaultReadObjectQueryRedirector, defaultReadObjectQueryRedirectorClassName, defaultReportQueryRedirector, defaultReportQueryRedirectorClassName, defaultTable, defaultUpdateObjectQueryRedirector, defaultUpdateObjectQueryRedirectorClassName, derivesIdMappings, descriptorCustomizerClassName, descriptorType, DO_NOT_SEND_CHANGES, ERROR, fetchGroupManager, fields, foreignKeyValuesForCaching, hasMultipleTableConstraintDependecy, hasNoncacheableMappings, hasRelationships, hasSimplePrimaryKey, historyPolicy, idValidation, initializationStage, INITIALIZED, INTERFACE, interfaceInitializationStage, interfacePolicy, INVALIDATE_CHANGED_OBJECTS, isCascadeOnDeleteSetOnDatabaseOnSecondaryTables, isNativeConnectionRequired, ISOLATE_CACHE_AFTER_TRANSACTION, ISOLATE_CACHE_ALWAYS, ISOLATE_FROM_CLIENT_SESSION, ISOLATE_NEW_DATA_AFTER_TRANSACTION, javaClass, javaClassName, lockableMappings, mappings, mappingsPostCalculateChanges, mappingsPostCalculateChangesOnDeleted, multipleTableForeignKeys, multipleTableInsertOrder, multitenantPolicy, NORMAL, optimisticLockingPolicy, partitioningPolicy, partitioningPolicyName, POST_INITIALIZED, preDeleteMappings, PREINITIALIZED, primaryKeyFields, primaryKeyIdValidations, properties, queryKeys, queryManager, referencingClasses, returnFieldsToGenerateInsert, returnFieldsToGenerateUpdate, returnFieldsToMergeInsert, returnFieldsToMergeUpdate, returningPolicies, returningPolicy, selectionFields, SEND_NEW_OBJECTS_WITH_CHANGES, SEND_OBJECT_CHANGES, sequence, sequenceNumberField, sequenceNumberName, serializedObjectPolicy, sessionName, shouldAcquireCascadedLocks, shouldAlwaysConformResultsInUnitOfWork, shouldBeReadOnly, shouldLockForClone, shouldOrderMappings, shouldRegisterResultsInUnitOfWork, shouldUseFullChangeSetsForNewObjects, tables, unconvertedProperties, UNDEFINED_ISOLATATION, UNDEFINED_OBJECT_CHANGE_BEHAVIOR, UNINITIALIZED, USE_SESSION_CACHE_AFTER_TRANSACTION, virtualAttributeMethods, weavingUsesPropertyAccess, wrapperPolicy
-
Fields inherited from class org.eclipse.persistence.core.descriptors.CoreDescriptor
attributeGroups, eventManager, field, inheritancePolicy, instantiationPolicy, objectBuilder
-
-
Constructor Summary
Constructors Constructor Description RelationalDescriptor()
PUBLIC: Return a new descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTableName(java.lang.String tableName)
PUBLIC: Specify the table name for the class of objects the receiver describes.java.lang.String
getTableName()
PUBLIC: Return the name of the descriptor's first table.java.util.Vector
getTableNames()
PUBLIC: Return the table names.boolean
isRelationalDescriptor()
PUBLIC: Return if the descriptor maps to a relational table.void
setDefaultTableName(java.lang.String defaultTableName)
PUBLIC: The descriptors default table can be configured if the first table is not desired.void
setTableName(java.lang.String tableName)
PUBLIC: Specify the table name for the class of objects the receiver describes.void
setTableNames(java.util.Vector tableNames)
PUBLIC: Specify the all table names for the class of objects the receiver describes.void
setTableQualifier(java.lang.String tableQualifier)
PUBLIC: Set the table Qualifier for this descriptor.-
Methods inherited from class org.eclipse.persistence.descriptors.ClassDescriptor
addAbstractQueryKey, addCascadeLockingPolicy, addConstraintDependencies, addConstraintDependency, addDirectMapping, addDirectMapping, addDirectQueryKey, addForeignKeyFieldForMultipleTable, addForeignKeyFieldNameForMultipleTable, addMapping, addMappingsPostCalculateChanges, addMappingsPostCalculateChangesOnDeleted, addPreDeleteMapping, addPrimaryKeyField, addPrimaryKeyFieldName, addQueryKey, addTable, addUnconvertedProperty, adjustMultipleTableInsertOrder, alwaysConformResultsInUnitOfWork, alwaysRefreshCache, alwaysRefreshCacheOnRemote, applyAmendmentMethod, applyAmendmentMethod, arePrimaryKeyFields, assignDefaultValues, buildBatchCriteriaByPK, buildCallFromStatement, buildDirectValuesFromFieldValue, buildField, buildField, buildField, buildFieldValueFromDirectValues, buildFieldValueFromForeignKeys, buildFieldValueFromNestedRow, buildFieldValueFromNestedRows, buildNestedRowFromFieldValue, buildNestedRowsFromFieldValue, checkDatabase, checkInheritanceTreeAggregateSettings, clearReferencingClasses, clone, convertClassNamesToClasses, createCopyPolicy, createInstantiationPolicy, createMultipleTableInsertOrder, createMultipleTableInsertOrderFromComparison, createTableComparison, createTableOrder, descriptorIsAggregate, descriptorIsAggregateCollection, descriptorIsForInterface, descriptorIsNormal, disableCacheHits, disableCacheHitsOnRemote, dontAlwaysConformResultsInUnitOfWork, dontAlwaysRefreshCache, dontAlwaysRefreshCacheOnRemote, dontDisableCacheHits, dontDisableCacheHitsOnRemote, dontOnlyRefreshCacheIfNewerVersion, extractDefaultTable, getAccessorTree, getAdditionalAggregateCollectionKeyFields, getAdditionalTablePrimaryKeyFields, getAdditionalWritableMapKeyFields, getAlias, getAllFields, getAllSelectionFields, getAllSelectionFields, getAmendmentClass, getAmendmentClassName, getAmendmentMethodName, getAttributeGroup, getAttributeGroups, getCacheInterceptorClass, getCacheInterceptorClassName, getCacheInvalidationPolicy, getCacheIsolation, getCacheKeyType, getCachePolicy, getCacheSynchronizationType, getCascadeLockingPolicies, getCMPPolicy, getConstraintDependencies, getCopyPolicy, getCopyPolicyClassName, getDefaultDeleteObjectQueryRedirector, getDefaultFetchGroup, getDefaultInsertObjectQueryRedirector, getDefaultQueryRedirector, getDefaultReadAllQueryRedirector, getDefaultReadObjectQueryRedirector, getDefaultReportQueryRedirector, getDefaultTable, getDefaultUpdateObjectQueryRedirector, getDerivesIdMappinps, getDescriptorCustomizerClassName, getDescriptorEventManager, getDescriptorInheritancePolicy, getDescriptorQueryManager, getDescriptorType, getDescriptorTypeValue, getEventManager, getFetchGroupManager, getFields, getForeignKeyValuesForCaching, getFullyMergeEntity, getHistoryPolicy, getIdentityMapClass, getIdentityMapSize, getIdValidation, getInheritancePolicy, getInheritancePolicyOrNull, getInstantiationPolicy, getInterfacePolicy, getInterfacePolicyOrNull, getJavaClass, getJavaClassName, getLockableMappings, getMappingForAttributeName, getMappings, getMappingsPostCalculateChanges, getMappingsPostCalculateChangesOnDeleted, getMultipleTableForeignKeyAssociations, getMultipleTableForeignKeys, getMultipleTableInsertOrder, getMultipleTablePrimaryKeyAssociations, getMultitenantPolicy, getObjectBuilder, getObjectChangePolicy, getObjectChangePolicyInternal, getOptimisticLockingPolicy, getPartitioningPolicy, getPartitioningPolicyName, getPreDeleteMappings, getPrimaryKeyFieldNames, getPrimaryKeyFields, getPrimaryKeyIdValidations, getProperties, getProperty, getQueryKeyNamed, getQueryKeys, getQueryManager, getRemoteIdentityMapClass, getRemoteIdentityMapSize, getReturnFieldsToGenerateInsert, getReturnFieldsToGenerateUpdate, getReturnFieldsToMergeInsert, getReturnFieldsToMergeUpdate, getReturningPolicies, getReturningPolicy, getRootDescriptor, getSelectionFields, getSelectionFields, getSequence, getSequenceNumberField, getSequenceNumberFieldName, getSequenceNumberName, getSerializedObjectPolicy, getSessionName, getTable, getTablePerClassPolicy, getTables, getTypedField, getUnconvertedProperties, getUnitOfWorkCacheIsolationLevel, getVirtualAttributeMethods, getWrapperPolicy, hasCascadeLockingPolicies, hasCMPPolicy, hasDependencyOnParts, hasDerivedId, hasEventManager, hasFetchGroupManager, hasInheritance, hasInterfacePolicy, hasMappingsPostCalculateChanges, hasMappingsPostCalculateChangesOnDeleted, hasMultipleTableConstraintDependecy, hasMultipleTables, hasMultitenantPolicy, hasNestedIdentityReference, hasNoncacheableMappings, hasPessimisticLockingPolicy, hasPreDeleteMappings, hasPrivatelyOwnedParts, hasQueryKeyOrMapping, hasRelationships, hasRelationshipsExceptBackpointer, hasReturningPolicies, hasReturningPolicy, hasSerializedObjectPolicy, hasSimplePrimaryKey, hasTablePerClassPolicy, hasTablePerMultitenantPolicy, hasTargetForeignKeyMapping, hasUnconvertedProperties, hasWrapperPolicy, initialize, initialize, initializeAggregateInheritancePolicy, initializeMultipleTablePrimaryKeyFields, initializeProperties, interfaceInitialization, isAbstract, isAggregateCollectionDescriptor, isAggregateDescriptor, isCascadeOnDeleteSetOnDatabaseOnSecondaryTables, isChildDescriptor, isDescriptorForInterface, isDescriptorTypeAggregate, isDescriptorTypeNormal, isEISDescriptor, isFullyInitialized, isInitialized, isInterfaceChildDescriptor, isInterfaceInitialized, isInvalid, isIsolated, isMultipleTableDescriptor, isNativeConnectionRequired, isObjectRelationalDataTypeDescriptor, isPrimaryKeySetAfterInsert, isProtectedIsolation, isReturnTypeRequiredForReturningPolicy, isSharedIsolation, isXMLDescriptor, newAggregateCollectionMapping, newAggregateMapping, newDirectCollectionMapping, newDirectMapping, newManyToManyMapping, newManyToOneMapping, newOneToManyMapping, newOneToOneMapping, newUnidirectionalOneToManyMapping, notifyReferencingDescriptorsOfIsolation, onlyRefreshCacheIfNewerVersion, postInitialize, preInitialize, preInitializeInheritancePolicy, preInterfaceInitialization, prepareCascadeLockingPolicy, rehashFieldDependancies, reInitializeJoinedAttributes, remoteInitialization, removeMappingForAttributeName, removeProperty, requiresInitialization, selfValidationAfterInitialization, selfValidationBeforeInitialization, setAccessorTree, setAdditionalTablePrimaryKeyFields, setAdditionalTablePrimaryKeyFields, setAlias, setAllFields, setAmendmentClass, setAmendmentClassName, setAmendmentMethodName, setCacheable, setCacheInterceptorClass, setCacheInterceptorClassName, setCacheInvalidationPolicy, setCacheIsolation, setCacheKeyType, setCachePolicy, setCacheSynchronizationType, setCMPPolicy, setConstraintDependencies, setCopyPolicy, setCopyPolicyClassName, setDefaultDeleteObjectQueryRedirector, setDefaultDeleteObjectQueryRedirectorClassName, setDefaultInsertObjectQueryRedirector, setDefaultInsertObjectQueryRedirectorClassName, setDefaultQueryRedirector, setDefaultQueryRedirectorClassName, setDefaultReadAllQueryRedirector, setDefaultReadAllQueryRedirectorClassName, setDefaultReadObjectQueryRedirector, setDefaultReadObjectQueryRedirectorClassName, setDefaultReportQueryRedirector, setDefaultReportQueryRedirectorClassName, setDefaultTable, setDefaultUpdateObjectQueryRedirector, setDefaultUpdateObjectQueryRedirectorClassName, setDescriptorCustomizerClassName, setDescriptorType, setDescriptorTypeValue, setEventManager, setExistenceChecking, setFetchGroupManager, setFields, setForeignKeyFieldNamesForMultipleTable, setFullyMergeEntity, setHasMultipleTableConstraintDependecy, setHasRelationships, setHasSimplePrimaryKey, setHistoryPolicy, setIdentityMapClass, setIdentityMapSize, setIdValidation, setInheritancePolicy, setInitializationStage, setInstantiationPolicy, setInterfaceInitializationStage, setInterfacePolicy, setInternalDefaultTable, setInternalDefaultTable, setIsCascadeOnDeleteSetOnDatabaseOnSecondaryTables, setIsIsolated, setIsNativeConnectionRequired, setJavaClass, setJavaClassName, setJavaInterface, setJavaInterfaceName, setLockableMappings, setMappings, setMultipleTableForeignKeys, setMultipleTableInsertOrder, setMultitenantPolicy, setObjectBuilder, setObjectChangePolicy, setOptimisticLockingPolicy, setPartitioningPolicy, setPartitioningPolicyName, setPrimaryKeyFieldName, setPrimaryKeyFieldNames, setPrimaryKeyFields, setPrimaryKeyIdValidations, setProperties, setProperty, setQueryKeys, setQueryManager, setReadOnly, setRemoteIdentityMapClass, setRemoteIdentityMapSize, setReturningPolicy, setSequence, setSequenceNumberField, setSequenceNumberFieldName, setSequenceNumberName, setSerializedObjectPolicy, setSessionName, setShouldAcquireCascadedLocks, setShouldAlwaysConformResultsInUnitOfWork, setShouldAlwaysRefreshCache, setShouldAlwaysRefreshCacheOnRemote, setShouldBeReadOnly, setShouldDisableCacheHits, setShouldDisableCacheHitsOnRemote, setShouldLockForClone, setShouldOnlyRefreshCacheIfNewerVersion, setShouldOrderMappings, setShouldRegisterResultsInUnitOfWork, setTablePerClassPolicy, setTables, setUnitOfWorkCacheIsolationLevel, setVirtualAttributeMethods, setWrapperPolicy, shouldAcquireCascadedLocks, shouldAlwaysConformResultsInUnitOfWork, shouldAlwaysRefreshCache, shouldAlwaysRefreshCacheOnRemote, shouldBeReadOnly, shouldDisableCacheHits, shouldDisableCacheHitsOnRemote, shouldIsolateObjectsInUnitOfWork, shouldIsolateObjectsInUnitOfWorkEarlyTransaction, shouldIsolateProtectedObjectsInUnitOfWork, shouldLockForClone, shouldOnlyRefreshCacheIfNewerVersion, shouldOrderMappings, shouldRegisterResultsInUnitOfWork, shouldUseAdditionalJoinExpression, shouldUseCacheIdentityMap, shouldUseFullChangeSetsForNewObjects, 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, usePropertyAccessForWeaving, useRemoteCacheIdentityMap, useRemoteFullIdentityMap, useRemoteHardCacheWeakIdentityMap, useRemoteNoIdentityMap, useRemoteSoftCacheWeakIdentityMap, useRemoteSoftIdentityMap, useRemoteWeakIdentityMap, useSelectedFieldsLocking, usesFieldLocking, useSoftCacheWeakIdentityMap, useSoftIdentityMap, usesOptimisticLocking, usesPropertyAccessForWeaving, usesSequenceNumbers, usesVersionLocking, useTimestampLocking, useTimestampLocking, useVersionLocking, useVersionLocking, useWeakIdentityMap, validateAfterInitialization, validateBeforeInitialization, validateMappingType, verifyMultipleTableInsertOrder, verifyMultipleTablesForeignKeysTables, verifyTableQualifiers
-
Methods inherited from class org.eclipse.persistence.core.descriptors.CoreDescriptor
addAttributeGroup
-
-
-
-
Method Detail
-
isRelationalDescriptor
public boolean isRelationalDescriptor()
PUBLIC: Return if the descriptor maps to a relational table.- Overrides:
isRelationalDescriptor
in classClassDescriptor
-
addTableName
public void addTableName(java.lang.String tableName)
PUBLIC: Specify the table name for the class of objects the receiver describes. If the table has a qualifier it should be specified using the dot notation, (i.e. "userid.employee"). This method is used if there is more than one table.- Overrides:
addTableName
in classClassDescriptor
-
getTableName
public java.lang.String getTableName()
PUBLIC: Return the name of the descriptor's first table. This method must only be called on single table descriptors.- Overrides:
getTableName
in classClassDescriptor
-
getTableNames
public java.util.Vector getTableNames()
PUBLIC: Return the table names.- Overrides:
getTableNames
in classClassDescriptor
-
setDefaultTableName
public void setDefaultTableName(java.lang.String defaultTableName)
PUBLIC: The descriptors default table can be configured if the first table is not desired.- Overrides:
setDefaultTableName
in classClassDescriptor
-
setTableName
public void setTableName(java.lang.String tableName) throws DescriptorException
PUBLIC: Specify the table name for the class of objects the receiver describes. If the table has a qualifier it should be specified using the dot notation, (i.e. "userid.employee"). This method is used for single table.- Overrides:
setTableName
in classClassDescriptor
- Throws:
DescriptorException
-
setTableNames
public void setTableNames(java.util.Vector tableNames)
PUBLIC: Specify the all table names for the class of objects the receiver describes. If the table has a qualifier it should be specified using the dot notation, (i.e. "userid.employee"). This method is used for multiple tables- Overrides:
setTableNames
in classClassDescriptor
-
setTableQualifier
public void setTableQualifier(java.lang.String tableQualifier)
PUBLIC: Set the table Qualifier for this descriptor. This table creator will be used for all tables in this descriptor- Overrides:
setTableQualifier
in classClassDescriptor
-
-