EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.oxm
Class XMLDescriptor

java.lang.Object
  extended by org.eclipse.persistence.descriptors.ClassDescriptor
      extended by org.eclipse.persistence.oxm.XMLDescriptor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class XMLDescriptor
extends ClassDescriptor

Use an XML project for nontransactional, nonpersistent (in-memory) conversions between Java objects and XML documents. An XMLDescriptor is a set of mappings that describe how an objects's data is to be represented in an XML document. XML descriptors describe Java objects that you map to simple and complex types defined by an XML schema document (XSD). Using XML descriptors in an EclipseLink XML project, you can configure XML mappings.

See Also:
org.eclipse.persistence.oxm.mappings, Serialized Form

Field Summary
 
Fields inherited from class org.eclipse.persistence.descriptors.ClassDescriptor
additionalAggregateCollectionKeyFields, additionalTablePrimaryKeyFields, additionalWritableMapKeyFields, AGGREGATE, AGGREGATE_COLLECTION, alias, allFields, amendmentClass, amendmentClassName, amendmentMethodName, cacheInterceptorClass, cacheInterceptorClassName, cacheInvalidationPolicy, cacheIsolation, cacheKeyType, cacheSynchronizationType, cascadeLockingPolicies, changePolicy, cmpPolicy, constraintDependencies, copyPolicy, copyPolicyClassName, defaultDeleteObjectQueryRedirector, defaultDeleteObjectQueryRedirectorClassName, defaultInsertObjectQueryRedirector, defaultInsertObjectQueryRedirectorClassName, defaultQueryRedirector, defaultQueryRedirectorClassName, defaultReadAllQueryRedirector, defaultReadAllQueryRedirectorClassName, defaultReadObjectQueryRedirector, defaultReadObjectQueryRedirectorClassName, defaultReportQueryRedirector, defaultReportQueryRedirectorClassName, defaultTable, defaultUpdateObjectQueryRedirector, defaultUpdateObjectQueryRedirectorClassName, derivesIdMappings, descriptorType, DO_NOT_SEND_CHANGES, ERROR, eventManager, fetchGroupManager, fields, foreignKeyValuesForCaching, hasMultipleTableConstraintDependecy, hasNoncacheableMappings, hasRelationships, hasSimplePrimaryKey, historyPolicy, identityMapClass, identityMapSize, idValidation, inheritancePolicy, initializationStage, INITIALIZED, instantiationPolicy, 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, NORMAL, objectBuilder, optimisticLockingPolicy, partitioningPolicy, partitioningPolicyName, POST_INITIALIZED, preDeleteMappings, PREINITIALIZED, primaryKeyFields, primaryKeyIdValidations, properties, queryKeys, queryManager, referencingClasses, remoteIdentityMapClass, remoteIdentityMapSize, returningPolicy, SEND_NEW_OBJECTS_WITH_CHANGES, SEND_OBJECT_CHANGES, sequence, sequenceNumberField, sequenceNumberName, sessionName, shouldAcquireCascadedLocks, shouldAlwaysConformResultsInUnitOfWork, shouldAlwaysRefreshCache, shouldAlwaysRefreshCacheOnRemote, shouldBeReadOnly, shouldDisableCacheHits, shouldDisableCacheHitsOnRemote, shouldOnlyRefreshCacheIfNewerVersion, shouldOrderMappings, shouldRegisterResultsInUnitOfWork, shouldUseFullChangeSetsForNewObjects, tables, UNDEFINED_ISOLATATION, UNDEFINED_OBJECT_CHANGE_BEHAVIOR, UNINITIALIZED, unitOfWorkCacheIsolationLevel, USE_SESSION_CACHE_AFTER_TRANSACTION, wrapperPolicy
 
Constructor Summary
XMLDescriptor()
          PUBLIC: Return a new XMLDescriptor.
 
Method Summary
 DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String xpathString)
          PUBLIC: Add a direct mapping to the receiver.
 DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String getMethodName, java.lang.String setMethodName, java.lang.String xpathString)
          PUBLIC: Add a direct to node mapping to the receiver.
 void addPrimaryKeyField(org.eclipse.persistence.internal.helper.DatabaseField field)
          ADVANCED: Specify the primary key field of the descriptors table.
 void addPrimaryKeyFieldName(java.lang.String fieldName)
          PUBLIC: Specify the primary key field of the descriptors table.
 void addRootElement(java.lang.String rootElementName)
          PUBLIC: Add a root element name for the Descriptor This value is stored in place of a table name
 java.util.Vector buildDirectValuesFromFieldValue(java.lang.Object fieldValue)
          INTERNAL: Extract the direct values from the specified field value.
 org.eclipse.persistence.internal.helper.DatabaseField buildField(org.eclipse.persistence.internal.helper.DatabaseField field)
          INTERNAL: This is used only in initialization.
 org.eclipse.persistence.internal.helper.DatabaseField buildField(java.lang.String fieldName)
          INTERNAL: A DatabaseField is built from the given field name.
 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 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(if necessary) and return the nested XMLRecord from the specified field value.
 java.util.Vector buildNestedRowsFromFieldValue(java.lang.Object fieldValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Build(if necessary) and return a Vector of the nested XMLRecords from the specified field value.
protected  org.eclipse.persistence.internal.helper.DatabaseTable extractDefaultTable()
          Aggregates use a dummy table as default.
 java.lang.String getDefaultRootElement()
          PUBLIC: Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects
 XMLField getDefaultRootElementField()
           
 javax.xml.namespace.QName getDefaultRootElementType()
           
 InheritancePolicy getInheritancePolicy()
          PUBLIC: The inheritance policy is used to define how a descriptor takes part in inheritance.
 NamespaceResolver getNamespaceResolver()
          PUBLIC: Return the NamespaceResolver associated with this descriptor
 NamespaceResolver getNonNullNamespaceResolver()
           
 XMLSchemaReference getSchemaReference()
          PUBLIC: Return the SchemaReference associated with this descriptor
 org.eclipse.persistence.internal.helper.DatabaseField getTypedField(org.eclipse.persistence.internal.helper.DatabaseField field)
          INTERNAL: searches first descriptor than its ReturningPolicy for an equal field
protected  org.eclipse.persistence.internal.helper.DatabaseField getTypedField(java.util.StringTokenizer stringTokenizer)
           
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mappings as a separate step.
 void initializeAggregateInheritancePolicy(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: This is needed by regular aggregate descriptors (because they require review); but not by XML aggregate descriptors.
 boolean isResultAlwaysXMLRoot()
           
 boolean isSequencedObject()
          INTERNAL: Indicates if the Object mapped by this descriptor is a sequenced data object and should be marshalled accordingly.
 boolean isWrapper()
           
 void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Post initializations after mappings are initialized.
 void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Allow the descriptor to initialize any dependencies on this session.
 boolean requiresInitialization()
          INTERNAL: XML descriptors are initialized normally, since they do not need to be cloned by XML aggregate mappings.
 void setDefaultRootElement(java.lang.String newDefaultRootElement)
          PUBLIC: Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects
 void setDefaultRootElementField(XMLField xmlField)
           
 void setDefaultRootElementType(javax.xml.namespace.QName type)
          The default root element type string will be stored until initialization - a QName will be created and stored on the default root element field during initialize.
 void setIsWrapper(boolean value)
           
 void setNamespaceResolver(NamespaceResolver newNamespaceResolver)
          PUBLIC: Set the NamespaceResolver to associate with this descriptor
 void setPrimaryKeyFields(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> thePrimaryKeyFields)
          INTERNAL: Set the primary key fields
 void setResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot)
           
 void setSchemaReference(XMLSchemaReference newSchemaReference)
          PUBLIC: Set the SchemaReference to associate with this descriptor
 void setSequencedObject(boolean isSequenced)
           
 void setShouldPreserveDocument(boolean shouldPreserveDocument)
          PUBLIC: Specifies that object built from this descriptor should retain any unmapped information from their original XML Document when being written back out.
 void setTableNames(java.util.Vector tableNames)
          PUBLIC: Specify the all table names for the class of objects the receiver describes.
 void setTables(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseTable> theTables)
          INTERNAL: Sets the tables
 boolean shouldPreserveDocument()
          PUBLIC: Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.
 boolean shouldWrapObject(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix)
           
protected  void validateMappingType(DatabaseMapping mapping)
           
 java.lang.Object wrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, boolean forceWrap)
          INTERNAL: Determines the appropriate object to return from the unmarshal call.
 java.lang.Object wrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, java.lang.String encoding, java.lang.String version, boolean forceWrap)
           
 java.lang.Object wrapObjectInXMLRoot(UnmarshalRecord unmarshalRecord, boolean forceWrap)
          INTERNAL: Determines the appropriate object to return from the unmarshal call.
 
Methods inherited from class org.eclipse.persistence.descriptors.ClassDescriptor
addAbstractQueryKey, addCascadeLockingPolicy, addConstraintDependencies, addConstraintDependency, addDirectQueryKey, addForeignKeyFieldForMultipleTable, addForeignKeyFieldNameForMultipleTable, addMapping, addMappingsPostCalculateChanges, addMappingsPostCalculateChangesOnDeleted, addQueryKey, addTable, addTableName, adjustMultipleTableInsertOrder, alwaysConformResultsInUnitOfWork, alwaysRefreshCache, alwaysRefreshCacheOnRemote, applyAmendmentMethod, applyAmendmentMethod, arePrimaryKeyFields, assignDefaultValues, buildCallFromStatement, buildField, buildFieldValueFromForeignKeys, buildFieldValueFromNestedRow, checkDatabase, checkInheritanceTreeAggregateSettings, clone, convertClassNamesToClasses, createCopyPolicy, createInstantiationPolicy, createMultipleTableInsertOrder, createMultipleTableInsertOrderFromComparison, createTableComparison, createTableOrder, descriptorIsAggregate, descriptorIsAggregateCollection, descriptorIsForInterface, descriptorIsNormal, disableCacheHits, disableCacheHitsOnRemote, dontAlwaysConformResultsInUnitOfWork, dontAlwaysRefreshCache, dontAlwaysRefreshCacheOnRemote, dontDisableCacheHits, dontDisableCacheHitsOnRemote, dontOnlyRefreshCacheIfNewerVersion, getAdditionalAggregateCollectionKeyFields, getAdditionalTablePrimaryKeyFields, getAdditionalWritableMapKeyFields, getAlias, getAllFields, getAmendmentClass, getAmendmentClassName, getAmendmentMethodName, getCacheInterceptorClass, getCacheInterceptorClassName, getCacheInvalidationPolicy, getCacheIsolation, getCacheKeyType, getCacheSynchronizationType, getCascadeLockingPolicies, getCMPPolicy, getConstraintDependencies, getCopyPolicy, getCopyPolicyClassName, getDefaultDeleteObjectQueryRedirector, getDefaultFetchGroup, getDefaultInsertObjectQueryRedirector, getDefaultQueryRedirector, getDefaultReadAllQueryRedirector, getDefaultReadObjectQueryRedirector, getDefaultReportQueryRedirector, getDefaultTable, getDefaultUpdateObjectQueryRedirector, getDerivesIdMappinps, getDescriptorEventManager, getDescriptorInheritancePolicy, getDescriptorQueryManager, getDescriptorType, getDescriptorTypeValue, getEventManager, getFetchGroupManager, getFields, getForeignKeyValuesForCaching, getHistoryPolicy, getIdentityMapClass, getIdentityMapSize, getIdValidation, getInheritancePolicyOrNull, getInstantiationPolicy, getInterfacePolicy, getInterfacePolicyOrNull, getJavaClass, getJavaClassName, getLockableMappings, getMappingForAttributeName, getMappings, getMappingsPostCalculateChanges, getMappingsPostCalculateChangesOnDeleted, getMultipleTableForeignKeyAssociations, getMultipleTableForeignKeys, getMultipleTableInsertOrder, getMultipleTablePrimaryKeyAssociations, getObjectBuilder, getObjectChangePolicy, getObjectChangePolicyInternal, getOptimisticLockingPolicy, getPartitioningPolicy, getPartitioningPolicyName, getPreDeleteMappings, getPrimaryKeyFieldNames, getPrimaryKeyFields, getPrimaryKeyIdValidations, getProperties, getProperty, getQueryKeyNamed, getQueryKeys, getQueryManager, getRemoteIdentityMapClass, getRemoteIdentityMapSize, getReturningPolicy, getRootDescriptor, getSequence, getSequenceNumberField, getSequenceNumberFieldName, getSequenceNumberName, getSessionName, getTable, getTableName, getTableNames, getTablePerClassPolicy, getTables, getUnitOfWorkCacheIsolationLevel, getWrapperPolicy, hasCascadeLockingPolicies, hasCMPPolicy, hasDependencyOnParts, hasDerivedId, hasFetchGroupManager, hasInheritance, hasInterfacePolicy, hasMappingsPostCalculateChanges, hasMappingsPostCalculateChangesOnDeleted, hasMultipleTableConstraintDependecy, hasMultipleTables, hasNoncacheableMappings, hasPessimisticLockingPolicy, hasPreDeleteMappings, hasPrivatelyOwnedParts, hasQueryKeyOrMapping, hasRelationships, hasReturningPolicy, hasSimplePrimaryKey, hasTablePerClassPolicy, hasWrapperPolicy, initializeMultipleTablePrimaryKeyFields, initializeProperties, interfaceInitialization, isAbstract, isAggregateCollectionDescriptor, isAggregateDescriptor, isCascadeOnDeleteSetOnDatabaseOnSecondaryTables, isChildDescriptor, isDescriptorForInterface, isDescriptorTypeAggregate, isDescriptorTypeNormal, isFullyInitialized, isInitialized, isInterfaceChildDescriptor, isInterfaceInitialized, isInvalid, isIsolated, isMultipleTableDescriptor, isNativeConnectionRequired, isObjectRelationalDataTypeDescriptor, isPrimaryKeySetAfterInsert, isProtectedIsolation, isReturnTypeRequiredForReturningPolicy, isSharedIsolation, notifyReferencingDescriptorsOfIsolation, onlyRefreshCacheIfNewerVersion, preInitializeInheritancePolicy, preInterfaceInitialization, prepareCascadeLockingPolicy, rehashFieldDependancies, reInitializeJoinedAttributes, remoteInitialization, removeMappingForAttributeName, removeProperty, selfValidationAfterInitialization, selfValidationBeforeInitialization, setAdditionalTablePrimaryKeyFields, setAdditionalTablePrimaryKeyFields, setAlias, setAllFields, setAmendmentClass, setAmendmentClassName, setAmendmentMethodName, setCacheInterceptorClass, setCacheInterceptorClassName, setCacheInvalidationPolicy, setCacheIsolation, setCacheKeyType, setCacheSynchronizationType, setCMPPolicy, setConstraintDependencies, setCopyPolicy, setCopyPolicyClassName, setDefaultDeleteObjectQueryRedirector, setDefaultDeleteObjectQueryRedirectorClassName, setDefaultInsertObjectQueryRedirector, setDefaultInsertObjectQueryRedirectorClassName, setDefaultQueryRedirector, setDefaultQueryRedirectorClassName, setDefaultReadAllQueryRedirector, setDefaultReadAllQueryRedirectorClassName, setDefaultReadObjectQueryRedirector, setDefaultReadObjectQueryRedirectorClassName, setDefaultReportQueryRedirector, setDefaultReportQueryRedirectorClassName, setDefaultTable, setDefaultTableName, setDefaultUpdateObjectQueryRedirector, setDefaultUpdateObjectQueryRedirectorClassName, setDescriptorType, setDescriptorTypeValue, setEventManager, setExistenceChecking, setFetchGroupManager, setFields, setForeignKeyFieldNamesForMultipleTable, 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, setObjectBuilder, setObjectChangePolicy, setOptimisticLockingPolicy, setPartitioningPolicy, setPartitioningPolicyName, setPrimaryKeyFieldName, setPrimaryKeyFieldNames, setPrimaryKeyIdValidations, setProperties, setProperty, setQueryKeys, setQueryManager, setReadOnly, setRemoteIdentityMapClass, setRemoteIdentityMapSize, setReturningPolicy, setSequence, setSequenceNumberField, setSequenceNumberFieldName, setSequenceNumberName, setSessionName, setShouldAcquireCascadedLocks, setShouldAlwaysConformResultsInUnitOfWork, setShouldAlwaysRefreshCache, setShouldAlwaysRefreshCacheOnRemote, setShouldBeReadOnly, setShouldDisableCacheHits, setShouldDisableCacheHitsOnRemote, setShouldOnlyRefreshCacheIfNewerVersion, setShouldOrderMappings, setShouldRegisterResultsInUnitOfWork, setTableName, setTablePerClassPolicy, setTableQualifier, setUnitOfWorkCacheIsolationLevel, setWrapperPolicy, shouldAcquireCascadedLocks, shouldAlwaysConformResultsInUnitOfWork, shouldAlwaysRefreshCache, shouldAlwaysRefreshCacheOnRemote, shouldBeReadOnly, shouldDisableCacheHits, shouldDisableCacheHitsOnRemote, shouldIsolateObjectsInUnitOfWork, shouldIsolateObjectsInUnitOfWorkEarlyTransaction, shouldIsolateProtectedObjectsInUnitOfWork, 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, useRemoteCacheIdentityMap, useRemoteFullIdentityMap, useRemoteHardCacheWeakIdentityMap, useRemoteNoIdentityMap, useRemoteSoftCacheWeakIdentityMap, useRemoteSoftIdentityMap, useRemoteWeakIdentityMap, useSelectedFieldsLocking, usesFieldLocking, useSoftCacheWeakIdentityMap, useSoftIdentityMap, usesOptimisticLocking, usesSequenceNumbers, usesVersionLocking, useTimestampLocking, useTimestampLocking, useVersionLocking, useVersionLocking, useWeakIdentityMap, validateAfterInitialization, validateBeforeInitialization, verifyMultipleTableInsertOrder, verifyMultipleTablesForeignKeysTables, verifyTableQualifiers
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLDescriptor

public XMLDescriptor()
PUBLIC: Return a new XMLDescriptor.

Method Detail

getDefaultRootElement

public java.lang.String getDefaultRootElement()
PUBLIC: Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects

Returns:
the default root element specified on this ClassDescriptor

shouldPreserveDocument

public boolean shouldPreserveDocument()
PUBLIC: Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.

Returns:
if this descriptor should preserve unmapped data

setShouldPreserveDocument

public void setShouldPreserveDocument(boolean shouldPreserveDocument)
PUBLIC: Specifies that object built from this descriptor should retain any unmapped information from their original XML Document when being written back out. By default unmapped data is not preserved.


addRootElement

public void addRootElement(java.lang.String rootElementName)
PUBLIC: Add a root element name for the Descriptor This value is stored in place of a table name

Parameters:
rootElementName - a root element to specify on this Descriptor

setDefaultRootElement

public void setDefaultRootElement(java.lang.String newDefaultRootElement)
PUBLIC: Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects

Parameters:
newDefaultRootElement - the default root element to specify on this ClassDescriptor

getNamespaceResolver

public NamespaceResolver getNamespaceResolver()
PUBLIC: Return the NamespaceResolver associated with this descriptor

Returns:
the NamespaceResolver associated with this descriptor
See Also:
NamespaceResolver

getNonNullNamespaceResolver

public NamespaceResolver getNonNullNamespaceResolver()

getInheritancePolicy

public InheritancePolicy getInheritancePolicy()
PUBLIC: The inheritance policy is used to define how a descriptor takes part in inheritance. All inheritance properties for both child and parent classes is configured in inheritance policy. Caution must be used in using this method as it lazy initializes an inheritance policy. Calling this on a descriptor that does not use inheritance will cause problems, #hasInheritance() must always first be called.

Overrides:
getInheritancePolicy in class ClassDescriptor
Returns:
the InheritancePolicy associated with this descriptor

setNamespaceResolver

public void setNamespaceResolver(NamespaceResolver newNamespaceResolver)
PUBLIC: Set the NamespaceResolver to associate with this descriptor

Parameters:
newNamespaceResolver - the NamespaceResolver to associate with this descriptor
See Also:
NamespaceResolver

getSchemaReference

public XMLSchemaReference getSchemaReference()
PUBLIC: Return the SchemaReference associated with this descriptor

Returns:
the SchemaReference associated with this descriptor
See Also:
org.eclipse.persistence.oxm.schema

setSchemaReference

public void setSchemaReference(XMLSchemaReference newSchemaReference)
PUBLIC: Set the SchemaReference to associate with this descriptor

Parameters:
newSchemaReference - the SchemaReference to associate with this descriptor
See Also:
org.eclipse.persistence.oxm.schema

validateMappingType

protected void validateMappingType(DatabaseMapping mapping)
Overrides:
validateMappingType in class ClassDescriptor

buildNestedRowFromFieldValue

public org.eclipse.persistence.internal.sessions.AbstractRecord buildNestedRowFromFieldValue(java.lang.Object fieldValue)
INTERNAL: Build(if necessary) and return the nested XMLRecord from the specified field value. The field value should be an XMLRecord or and XMLElement

Overrides:
buildNestedRowFromFieldValue in class ClassDescriptor

buildNestedRowsFromFieldValue

public java.util.Vector buildNestedRowsFromFieldValue(java.lang.Object fieldValue,
                                                      org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build(if necessary) and return a Vector of the nested XMLRecords from the specified field value. The field value should be a Vector, an XMLRecord, or an XMLElement

Overrides:
buildNestedRowsFromFieldValue in class ClassDescriptor

addDirectMapping

public DatabaseMapping addDirectMapping(java.lang.String attributeName,
                                        java.lang.String xpathString)
PUBLIC: Add a direct mapping to the receiver. The new mapping specifies that an instance variable of the class of objects which the receiver describes maps in the default manner for its type to the indicated database field.

Overrides:
addDirectMapping in class ClassDescriptor
Parameters:
attributeName - the name of an instance variable of the class which the receiver describes.
xpathString - the xpath of the xml element or attribute which corresponds with the designated instance variable.
Returns:
The newly created DatabaseMapping is returned.

addDirectMapping

public DatabaseMapping addDirectMapping(java.lang.String attributeName,
                                        java.lang.String getMethodName,
                                        java.lang.String setMethodName,
                                        java.lang.String xpathString)
PUBLIC: Add a direct to node mapping to the receiver. The new mapping specifies that a variable accessed by the get and set methods of the class of objects which the receiver describes maps in the default manner for its type to the indicated database field.

Overrides:
addDirectMapping in class ClassDescriptor

addPrimaryKeyFieldName

public void addPrimaryKeyFieldName(java.lang.String fieldName)
Description copied from class: ClassDescriptor
PUBLIC: Specify the primary key field of the descriptors table. This should be called for each field that makes up the primary key of the table. If the descriptor has many tables, this must be the primary key in the first table, if the other tables have the same primary key nothing else is required, otherwise a primary key/foreign key field mapping must be provided for each of the other tables.

Overrides:
addPrimaryKeyFieldName in class ClassDescriptor
See Also:
#addMultipleTableForeignKeyFieldName(String, String);

addPrimaryKeyField

public void addPrimaryKeyField(org.eclipse.persistence.internal.helper.DatabaseField field)
Description copied from class: ClassDescriptor
ADVANCED: Specify the primary key field of the descriptors table. This should be called for each field that makes up the primary key of the table. This can be used for advanced field types, such as XML nodes, or to set the field type.

Overrides:
addPrimaryKeyField in class ClassDescriptor

setPrimaryKeyFields

public void setPrimaryKeyFields(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> thePrimaryKeyFields)
Description copied from class: ClassDescriptor
INTERNAL: Set the primary key fields

Overrides:
setPrimaryKeyFields in class ClassDescriptor

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 could be a vector or could be a text value if only a single value.

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 a Vector.

Overrides:
buildFieldValueFromDirectValues 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.

Overrides:
buildFieldValueFromNestedRows in class ClassDescriptor
Throws:
DatabaseException

buildField

public org.eclipse.persistence.internal.helper.DatabaseField buildField(java.lang.String fieldName)
INTERNAL: A DatabaseField is built from the given field name.

Overrides:
buildField in class ClassDescriptor

buildField

public org.eclipse.persistence.internal.helper.DatabaseField buildField(org.eclipse.persistence.internal.helper.DatabaseField field)
INTERNAL: This is used only in initialization.

Overrides:
buildField in class ClassDescriptor

initializeAggregateInheritancePolicy

public void initializeAggregateInheritancePolicy(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This is needed by regular aggregate descriptors (because they require review); but not by XML aggregate descriptors.

Overrides:
initializeAggregateInheritancePolicy in class ClassDescriptor

setTableNames

public void setTableNames(java.util.Vector tableNames)
Description copied from class: ClassDescriptor
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 class ClassDescriptor

setTables

public void setTables(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseTable> theTables)
INTERNAL: Sets the tables

Overrides:
setTables in class ClassDescriptor

preInitialize

public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                   throws DescriptorException
INTERNAL: Allow the descriptor to initialize any dependencies on this session.

Overrides:
preInitialize in class ClassDescriptor
Throws:
DescriptorException

postInitialize

public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                    throws DescriptorException
INTERNAL: Post initializations after mappings are initialized.

Overrides:
postInitialize in class ClassDescriptor
Throws:
DescriptorException

initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                throws DescriptorException
INTERNAL: Initialize the mappings as a separate step. This is done as a separate step to ensure that inheritance has been first resolved.

Overrides:
initialize in class ClassDescriptor
Throws:
DescriptorException

requiresInitialization

public boolean requiresInitialization()
INTERNAL: XML descriptors are initialized normally, since they do not need to be cloned by XML aggregate mappings.

Overrides:
requiresInitialization in class ClassDescriptor

extractDefaultTable

protected org.eclipse.persistence.internal.helper.DatabaseTable extractDefaultTable()
Aggregates use a dummy table as default.

Overrides:
extractDefaultTable in class ClassDescriptor

wrapObjectInXMLRoot

public java.lang.Object wrapObjectInXMLRoot(UnmarshalRecord unmarshalRecord,
                                            boolean forceWrap)
INTERNAL: Determines the appropriate object to return from the unmarshal call. The method will either return the object created in the xmlReader.parse() call or an instance of XMLRoot. An XMLRoot instance will be returned if the DOMRecord element being unmarshalled does not equal the descriptor's default root element.

Parameters:
unmarshalRecord -
Returns:
object

wrapObjectInXMLRoot

public java.lang.Object wrapObjectInXMLRoot(java.lang.Object object,
                                            java.lang.String elementNamespaceUri,
                                            java.lang.String elementLocalName,
                                            java.lang.String elementPrefix,
                                            boolean forceWrap)
INTERNAL: Determines the appropriate object to return from the unmarshal call. The method will either return the object created in the xmlReader.parse() call or an instance of XMLRoot. An XMLRoot instance will be returned if the DOMRecord element being unmarshalled does not equal the descriptor's default root element.

Parameters:
object -
elementNamespaceUri -
elementLocalName -
elementPrefix -
Returns:
object

wrapObjectInXMLRoot

public java.lang.Object wrapObjectInXMLRoot(java.lang.Object object,
                                            java.lang.String elementNamespaceUri,
                                            java.lang.String elementLocalName,
                                            java.lang.String elementPrefix,
                                            java.lang.String encoding,
                                            java.lang.String version,
                                            boolean forceWrap)

shouldWrapObject

public boolean shouldWrapObject(java.lang.Object object,
                                java.lang.String elementNamespaceUri,
                                java.lang.String elementLocalName,
                                java.lang.String elementPrefix)

getDefaultRootElementField

public XMLField getDefaultRootElementField()

setDefaultRootElementField

public void setDefaultRootElementField(XMLField xmlField)

getDefaultRootElementType

public javax.xml.namespace.QName getDefaultRootElementType()

setDefaultRootElementType

public void setDefaultRootElementType(javax.xml.namespace.QName type)
The default root element type string will be stored until initialization - a QName will be created and stored on the default root element field during initialize.

Parameters:
type -

isSequencedObject

public boolean isSequencedObject()
INTERNAL:

Indicates if the Object mapped by this descriptor is a sequenced data object and should be marshalled accordingly.


setSequencedObject

public void setSequencedObject(boolean isSequenced)

isWrapper

public boolean isWrapper()

setIsWrapper

public void setIsWrapper(boolean value)

isResultAlwaysXMLRoot

public boolean isResultAlwaysXMLRoot()

setResultAlwaysXMLRoot

public void setResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot)

getTypedField

public org.eclipse.persistence.internal.helper.DatabaseField getTypedField(org.eclipse.persistence.internal.helper.DatabaseField field)
Description copied from class: ClassDescriptor
INTERNAL: searches first descriptor than its ReturningPolicy for an equal field

Overrides:
getTypedField in class ClassDescriptor

getTypedField

protected org.eclipse.persistence.internal.helper.DatabaseField getTypedField(java.util.StringTokenizer stringTokenizer)

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference