FileDocCategorySizeDatePackage
MetadataDescriptor.javaAPI DocGlassfish v2 API38524Tue May 22 16:54:24 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.metadata

MetadataDescriptor

public class MetadataDescriptor extends Object
Common metatata descriptor for the annotation and xml processors. This class is a wrap on an actual TopLink descriptor.
author
Guy Pelletier
since
TopLink EJB 3.0 Reference Implementation

Fields Summary
protected ClassAccessor
m_accessor
protected ClassDescriptor
m_descriptor
protected Class
m_javaClass
protected boolean
m_ignoreIDs
protected boolean
m_ignoreTables
protected boolean
m_isCascadePersist
protected boolean
m_ignoreAnnotations
protected boolean
m_ignoreInheritance
protected Boolean
m_usesPropertyAccess
protected String
m_xmlSchema
protected String
m_xmlCatalog
protected String
m_xmlAccess
protected String
m_primaryTableName
protected String
m_embeddedIdAttributeName
protected List
m_idAttributeNames
protected List
m_orderByAttributeNames
protected List
m_idOrderByAttributeNames
protected List
m_aggregateDescriptors
protected Map
m_pkClassIDs
protected Map
m_accessors
protected Map
m_pkJoinColumnAssociations
protected Map
m_attributeOverrides
protected Map
m_associationOverrides
protected Map
m_relationshipAccessors
protected Map
m_biDirectionalManyToManyAccessors
Constructors Summary
public MetadataDescriptor(Class javaClass)
INTERNAL:

        init();
        m_descriptor = new RelationalDescriptor();
        m_descriptor.setExistenceChecking("Check database");
        m_descriptor.setAlias("");
        setJavaClass(javaClass);
    
Methods Summary
public voidaddAccessor(oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor accessor)
INTERNAL:

        m_accessors.put(accessor.getAttributeName(), accessor);
         
        if (accessor.isRelationship()) {
            m_relationshipAccessors.put(accessor.getAttributeName(), (RelationshipAccessor) accessor);
        }
         
        // Store bidirectional ManyToMany relationships so that we may look at 
        // attribute names when defaulting join columns.
        if (accessor.isManyToMany()) {
            String mappedBy = ((RelationshipAccessor) accessor).getMappedBy();
            
            if (! mappedBy.equals("")) {
                String referenceClassName = accessor.getReferenceClassName();
                
                // Initialize the map of bi-directional mappings for this class.
                if (! m_biDirectionalManyToManyAccessors.containsKey(referenceClassName)) {
                    m_biDirectionalManyToManyAccessors.put(referenceClassName, new HashMap<String, MetadataAccessor>());
                }
            
                m_biDirectionalManyToManyAccessors.get(referenceClassName).put(mappedBy, accessor);
            }
        }
    
public voidaddAggregateDescriptor(oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor aggregateDescriptor)
INTERNAL:

        m_aggregateDescriptors.add(aggregateDescriptor);
    
public voidaddAssociationOverride(java.lang.String attributeName, oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataJoinColumns joinColumns)
INTERNAL:

        m_associationOverrides.put(attributeName, joinColumns);   
     
public voidaddAttributeOverride(oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataColumn column)
INTERNAL:

        m_attributeOverrides.put(column.getAttributeName(), column);
    
public voidaddClassIndicator(java.lang.Class entityClass, java.lang.String value)
INTERNAL:

        if (m_accessor.isInheritanceSubclass()) {
            m_accessor.getInheritanceParentDescriptor().addClassIndicator(entityClass, value);   
        } else {
            m_descriptor.getInheritancePolicy().addClassNameIndicator(entityClass.getName(), value);
        }
    
public voidaddDefaultEventListener(oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener listener)
INTERNAL:

        m_descriptor.getEventManager().addDefaultEventListener(listener);
    
public voidaddEntityListenerEventListener(oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener listener)
INTERNAL:

        m_descriptor.getEventManager().addEntityListenerEventListener(listener);
    
public voidaddIdAttributeName(java.lang.String idAttributeName)
INTERNAL:

        m_idAttributeNames.add(idAttributeName);    
    
public voidaddMapping(oracle.toplink.essentials.mappings.DatabaseMapping mapping)
INTERNAL:

        m_descriptor.addMapping(mapping);
    
public voidaddMultipleTableForeignKeyField(oracle.toplink.essentials.internal.helper.DatabaseField pkField, oracle.toplink.essentials.internal.helper.DatabaseField fkField)
INTERNAL:

        m_descriptor.addMultipleTableForeignKeyField(pkField, fkField);
        m_pkJoinColumnAssociations.put(fkField.getName(), pkField.getName());
    
public voidaddMultipleTablePrimaryKeyField(oracle.toplink.essentials.internal.helper.DatabaseField pkField, oracle.toplink.essentials.internal.helper.DatabaseField fkField)
INTERNAL:

        m_descriptor.addMultipleTablePrimaryKeyField(pkField, fkField);
    
public voidaddPKClassId(java.lang.String attributeName, java.lang.reflect.Type type)
INTERNAL: We store these to validate the primary class when processing the entity class.

        m_pkClassIDs.put(attributeName, type);
    
public voidaddPrimaryKeyField(oracle.toplink.essentials.internal.helper.DatabaseField field)
INTERNAL:

        m_descriptor.addPrimaryKeyField(field);
    
public voidaddTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)
INTERNAL:

        m_descriptor.addTable(table);
    
public booleanexcludeSuperclassListeners()
INTERNAL:

        return m_descriptor.getEventManager().excludeSuperclassListeners();
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessorgetAccessorFor(java.lang.String fieldOrPropertyName)
INTERNAL: This method will first check for an accessor with name equal to fieldOrPropertyName (that is, assumes it is a field name). If no accessor is found than it assumes fieldOrPropertyName is a property name and converts it to its corresponding field name and looks for the accessor again. If still no accessor is found and this descriptor metadata is and an inheritance sublcass, than it will then look on the root metadata descriptor. Null is returned otherwise.

    	MetadataAccessor accessor = m_accessors.get(fieldOrPropertyName);
        
        if (accessor == null) {
            // Perhaps we have a property name ...
            accessor = m_accessors.get(MetadataHelper.getAttributeNameFromMethodName(fieldOrPropertyName));
           
            // If still no accessor and we are an inheritance subclass, check 
            // the root descriptor now.
            if (accessor == null && m_accessor.isInheritanceSubclass()) {
                accessor = m_accessor.getInheritanceParentDescriptor().getAccessorFor(fieldOrPropertyName);
            }
        }
        
        return accessor;
    
public java.lang.StringgetAlias()
INTERNAL:

        return m_descriptor.getAlias();
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataJoinColumnsgetAssociationOverrideFor(java.lang.String attributeName)
INTERNAL:

        return m_associationOverrides.get(attributeName);
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataColumngetAttributeOverrideFor(java.lang.String attributeName)
INTERNAL:

        return m_attributeOverrides.get(attributeName);
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessorgetBiDirectionalManyToManyAccessor(java.lang.String className, java.lang.String attributeName)
INTERNAL: Assumes hasBidirectionalManyToManyAccessorFor has been called before hand.

        return m_biDirectionalManyToManyAccessors.get(className).get(attributeName);
    
public java.lang.StringgetCatalog()
INTERNAL:

    	return m_xmlCatalog;
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessorgetClassAccessor()
INTERNAL:

        return m_accessor;
    
public oracle.toplink.essentials.descriptors.ClassDescriptorgetClassDescriptor()
INTERNAL:

        return m_descriptor;
    
public oracle.toplink.essentials.internal.helper.DatabaseFieldgetClassIndicatorField()
INTERNAL:

        if (m_accessor.getInheritanceParentDescriptor() != null) {
            return m_accessor.getInheritanceParentDescriptor().getClassDescriptor().getInheritancePolicy().getClassIndicatorField();
        } else {
            if (getClassDescriptor().hasInheritance()) {
                return getClassDescriptor().getInheritancePolicy().getClassIndicatorField();
            } else {
                return null;
            }
        }
    
public java.lang.StringgetDefaultTableName()
INTERNAL: The default table name is the descriptor alias, unless this descriptor metadata is an inheritance subclass with a SINGLE_TABLE strategy. Then it is the table name of the root descriptor metadata.

        String defaultTableName = getAlias().toUpperCase();
        
        if (m_accessor.isInheritanceSubclass()) {    
            if (m_accessor.getInheritanceParentDescriptor().usesSingleTableInheritanceStrategy()) {
                defaultTableName = m_accessor.getInheritanceParentDescriptor().getPrimaryTableName();
            }
        }
        
        return defaultTableName;
    
public java.lang.StringgetEmbeddedIdAttributeName()
INTERNAL:

        return m_embeddedIdAttributeName;
    
public java.lang.StringgetIdAttributeName()
INTERNAL: Return the primary key attribute name for this entity.

        if (getIdAttributeNames().isEmpty()) {
            if (m_accessor.isInheritanceSubclass()) {
                return m_accessor.getInheritanceParentDescriptor().getIdAttributeName();
            } else {
                return "";
            }
        } else {
            return (String) getIdAttributeNames().get(0);
        }
    
public java.util.ListgetIdAttributeNames()
INTERNAL: Return the id attribute names declared on this descriptor metadata.

        return m_idAttributeNames;
    
public java.util.ListgetIdOrderByAttributeNames()
INTERNAL: Return the primary key attribute names for this entity. If there are no id attribute names set then we are either: 1) an inheritance subclass, get the id attribute names from the root of the inheritance structure. 2) we have an embedded id. Get the id attribute names from the embedded descriptor metadata, which is equal the attribute names of all the direct to field mappings on that descriptor metadata. Currently does not traverse nested embeddables.

        if (m_idOrderByAttributeNames.isEmpty()) {
            if (m_idAttributeNames.isEmpty()) {
                if (m_accessor.isInheritanceSubclass()) {  
                    // Get the id attribute names from our root parent.
                    m_idOrderByAttributeNames = m_accessor.getInheritanceParentDescriptor().getIdAttributeNames();
                } else {
                    // We must have a composite primary key as a result of an embedded id.
                    m_idOrderByAttributeNames = getAccessorFor(getEmbeddedIdAttributeName()).getReferenceDescriptor().getOrderByAttributeNames();
                } 
            } else {
                m_idOrderByAttributeNames = m_idAttributeNames;
            }
        }
            
        return m_idOrderByAttributeNames;
    
public java.lang.ClassgetJavaClass()
INTERNAL:

        return m_javaClass;
    
public java.lang.StringgetJavaClassName()
INTERNAL:

        return m_descriptor.getJavaClassName();
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataLoggergetLogger()
INTERNAL:

        return getClassAccessor().getLogger();
	
public oracle.toplink.essentials.mappings.DatabaseMappinggetMappingForAttributeName(java.lang.String attributeName)
INTERNAL:

        return getMappingForAttributeName(attributeName, null);
    
public oracle.toplink.essentials.mappings.DatabaseMappinggetMappingForAttributeName(java.lang.String attributeName, oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor referencingAccessor)
INTERNAL: Non-owning mappings that need to look up the owning mapping, should call this method with their respective accessor to check for circular mappedBy references. If the referencingAccessor is null, no check will be made.

        MetadataAccessor accessor = (MetadataAccessor) getAccessorFor(attributeName);
        
        if (accessor != null) {
            // If the accessor is a relationship accessor than it may or may
            // not have been processed yet. Fast track its processing if it
            // needs to be. The process call will do nothing if it has already
            // been processed.
            if (accessor.isRelationship()) {
                RelationshipAccessor relationshipAccessor = (RelationshipAccessor) accessor;
                
                // Check that we don't have circular mappedBy values which 
                // will cause an infinite loop.
                if (referencingAccessor != null && ! relationshipAccessor.isManyToOne() && relationshipAccessor.getMappedBy().equals(referencingAccessor.getAttributeName())) {
                    getValidator().throwCircularMappedByReferences(referencingAccessor.getJavaClass(), referencingAccessor.getAttributeName(), getJavaClass(), attributeName);
                }
                
                relationshipAccessor.processRelationship();
            }
            
            return m_descriptor.getMappingForAttributeName(attributeName);
        }
        
        // We didn't find a mapping on this descriptor, check our aggregate 
        // descriptors now.
        for (MetadataDescriptor aggregateDmd : m_aggregateDescriptors) {
            DatabaseMapping mapping = aggregateDmd.getMappingForAttributeName(attributeName, referencingAccessor);
            
            if (mapping != null) {
                return mapping;
            }
        }
        
        // We didn't find a mapping on the aggregate descriptors. If we are an
        // inheritance subclass, check for a mapping on the inheritance root
        // descriptor metadata.
        if (m_accessor.isInheritanceSubclass()) {
            return m_accessor.getInheritanceParentDescriptor().getMappingForAttributeName(attributeName, referencingAccessor);
        }
        
        // Found nothing ... return null.
        return null;
    
public java.util.ListgetMappings()
INTERNAL:

        return m_descriptor.getMappings();
    
public java.util.ListgetOrderByAttributeNames()
INTERNAL: This will return the attribute names for all the direct to field mappings on this descriptor metadata. This method will typically be called when an

Embedded
or @EmbeddedId attribute has been specified in an @OrderBy.

        if (m_orderByAttributeNames.isEmpty()) {
            for (DatabaseMapping mapping : getMappings()) {
                if (mapping.isDirectToFieldMapping()) {
                    m_orderByAttributeNames.add(mapping.getAttributeName());
                }
            }
        }
        
        return m_orderByAttributeNames;
    
public java.lang.StringgetPKClassName()
INTERNAL:

        String pkClassName = null;
        
        if (m_descriptor.hasCMPPolicy()) {
            pkClassName = ((CMP3Policy) m_descriptor.getCMPPolicy()).getPKClassName();    
        }
        
        return pkClassName;
    
public java.lang.StringgetPrimaryKeyFieldName()
INTERNAL: Method to return the primary key field name for the given descriptor metadata. Assumes there is one.

        return ((DatabaseField)(getPrimaryKeyFields().iterator().next())).getName();
    
public java.util.ListgetPrimaryKeyFieldNames()
INTERNAL: Method to return the primary key field names for the given descriptor metadata. getPrimaryKeyFieldNames() on ClassDescriptor returns qualified names. We don't want that.

        List<DatabaseField> primaryKeyFields = getPrimaryKeyFields();
        List<String> primaryKeyFieldNames = new ArrayList<String>(primaryKeyFields.size());
        
        for (DatabaseField primaryKeyField : primaryKeyFields) {
            primaryKeyFieldNames.add(primaryKeyField.getName());
        }
        
        return primaryKeyFieldNames;
    
public java.util.ListgetPrimaryKeyFields()
INTERNAL: Return the primary key fields for this descriptor metadata. If this is an inheritance subclass and it has no primary key fields, then grab the primary key fields from the root.

        List<DatabaseField> primaryKeyFields = m_descriptor.getPrimaryKeyFields();
        
        if (primaryKeyFields.isEmpty() && m_accessor.isInheritanceSubclass()) {
            primaryKeyFields = m_accessor.getInheritanceParentDescriptor().getPrimaryKeyFields();
        }
        
        return primaryKeyFields;
    
public java.lang.StringgetPrimaryKeyJoinColumnAssociation(java.lang.String foreignKeyName)
INTERNAL: Recursively check the potential chaining of the primart key fields from a inheritance subclass, all the way to the root of the inheritance hierarchy.

        String primaryKeyName = m_pkJoinColumnAssociations.get(foreignKeyName);
        
        if (primaryKeyName == null || ! m_accessor.isInheritanceSubclass()) {
            return foreignKeyName;
        } else {
            return m_accessor.getInheritanceParentDescriptor().getPrimaryKeyJoinColumnAssociation(primaryKeyName);
        } 
    
public java.lang.StringgetPrimaryKeyTableName()
INTERNAL: Assumes there is one primary key field set. This method should be called when qualifying any primary key field (from a join column) for this descriptor. This method was created because in an inheritance hierarchy with a joined strategy we can't use getPrimaryTableName() since it would return the wrong table name. From the spec, the primary key must be defined on the entity that is the root of the entity hierarchy or on a mapped superclass of the entity hierarchy. The primary key must be defined exactly once in an entity hierarchy.

        return ((DatabaseField)(getPrimaryKeyFields().iterator().next())).getTable().getQualifiedName();
	
public java.lang.StringgetPrimaryTableName()
INTERNAL:

        if (m_primaryTableName == null && m_accessor.isInheritanceSubclass()) {
            return m_accessor.getInheritanceParentDescriptor().getPrimaryTableName();
        } else {
            if (m_descriptor.isAggregateDescriptor()) {
                // Aggregate descriptors don't have table names.
                return "";
            }
            
            return m_primaryTableName;
        }
	
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProjectgetProject()
INTERNAL:

        return getClassAccessor().getProject();
	
public java.util.CollectiongetRelationshipAccessors()
INTERNAL:

        return m_relationshipAccessors.values();
    
public java.lang.StringgetSchema()
INTERNAL:

    	return m_xmlSchema;
    
public oracle.toplink.essentials.internal.helper.DatabaseFieldgetSequenceNumberField()
INTERNAL:

        return m_descriptor.getSequenceNumberField();
    
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidatorgetValidator()
INTERNAL:

        return getClassAccessor().getValidator();
    
public booleanhasAssociationOverrideFor(java.lang.String attributeName)
INTERNAL:

        return m_associationOverrides.containsKey(attributeName);
    
public booleanhasAttributeOverrideFor(java.lang.String attributeName)
INTERNAL:

        return m_attributeOverrides.containsKey(attributeName);
    
public booleanhasBiDirectionalManyToManyAccessorFor(java.lang.String className, java.lang.String attributeName)
INTERNAL:

        if (m_biDirectionalManyToManyAccessors.containsKey(className)) {
            return m_biDirectionalManyToManyAccessors.get(className).containsKey(attributeName);
        }
        
        return false;
    
public booleanhasCompositePrimaryKey()
INTERNAL:

        return getPrimaryKeyFields().size() > 1 || getPKClassName() != null;
    
public booleanhasEmbeddedIdAttribute()
INTERNAL:

        return m_embeddedIdAttributeName != null;
    
public booleanhasInheritance()
INTERNAL:

        return m_descriptor.hasInheritance();
    
public booleanhasMappingForAttributeName(java.lang.String attributeName)
INTERNAL:

        return m_descriptor.getMappingForAttributeName(attributeName) != null;
    
public booleanhasPrimaryKeyFields()
INTERNAL: Return true is the descriptor has primary key fields set.

		return m_descriptor.getPrimaryKeyFields().size() > 0;
    
public booleanignoreAnnotations()
INTERNAL: Indicates whether or not annotations should be ignored, i.e. only default values processed.

    	return m_ignoreAnnotations;
    
public booleanignoreIDs()
INTERNAL:

        return m_ignoreIDs;    
    
public booleanignoreInheritance()
INTERNAL:

        return m_ignoreInheritance;    
    
public booleanignoreTables()
INTERNAL:

        return m_ignoreTables;    
    
private voidinit()
INTERNAL:

        m_xmlAccess = "";
        m_xmlSchema = "";
        m_xmlCatalog = "";
        
        m_ignoreIDs = false;
        m_ignoreTables = false;
        m_isCascadePersist = false;
        m_ignoreInheritance = false;
        m_ignoreAnnotations = false;
        
        m_idAttributeNames = new ArrayList<String>();
        m_orderByAttributeNames = new ArrayList<String>();
        m_idOrderByAttributeNames = new ArrayList<String>();
        m_aggregateDescriptors = new ArrayList<MetadataDescriptor>();
        
        m_pkClassIDs = new HashMap<String, Type>();
        m_accessors = new HashMap<String, MetadataAccessor>();
        m_pkJoinColumnAssociations = new HashMap<String, String>();
        m_attributeOverrides = new HashMap<String, MetadataColumn>();
        m_associationOverrides = new HashMap<String, MetadataJoinColumns>();
        
        m_relationshipAccessors = new HashMap<String, RelationshipAccessor>();
        m_biDirectionalManyToManyAccessors = new HashMap<String, Map<String, MetadataAccessor>>();
    
public booleanisCascadePersist()
INTERNAL: Indicates that cascade-persist should be applied to all relationship mappings for this entity.

    	return m_isCascadePersist;
    
public booleanisEmbeddable()
INTERNAL:

        return m_descriptor.isAggregateDescriptor();
    
public booleanisEmbeddableCollection()
INTERNAL:

        return m_descriptor.isAggregateCollectionDescriptor();
    
public booleanisXmlFieldAccess()
INTERNAL: Indicates that we found an XML field access type for this metadata descriptor.

        return m_xmlAccess.equals(XMLConstants.FIELD);
    
public booleanisXmlPropertyAccess()
INTERNAL: Indicates that we found an XML property access type for this metadata descriptor.

        return m_xmlAccess.equals(XMLConstants.PROPERTY);
    
public booleanpkClassWasNotValidated()
INTERNAL:

        return ! m_pkClassIDs.isEmpty();
    
public voidsetAccess(java.lang.String access)
INTERNAL:

        m_xmlAccess = access;
    
public voidsetAlias(java.lang.String alias)
INTERNAL:

        m_descriptor.setAlias(alias);
    
public voidsetCatalog(java.lang.String xmlCatalog)
INTERNAL:

    	m_xmlCatalog = xmlCatalog;
    
public voidsetClassAccessor(oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor accessor)
INTERNAL:

        m_accessor = accessor;
    
public voidsetClassIndicatorField(oracle.toplink.essentials.internal.helper.DatabaseField field)
INTERNAL:

        m_descriptor.getInheritancePolicy().setClassIndicatorField(field);    
    
public voidsetDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL:

        m_descriptor = descriptor;
    
public voidsetEmbeddedIdAttributeName(java.lang.String embeddedIdAttributeName)
INTERNAL:

        m_embeddedIdAttributeName = embeddedIdAttributeName;
    
public voidsetEntityEventListener(oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener listener)
INTERNAL:

        m_descriptor.getEventManager().setEntityEventListener(listener);
    
public voidsetExcludeDefaultListeners(boolean excludeDefaultListeners)
INTERNAL:

        m_descriptor.getEventManager().setExcludeDefaultListeners(excludeDefaultListeners);
    
public voidsetExcludeSuperclassListeners(boolean excludeSuperclassListeners)
INTERNAL:

        m_descriptor.getEventManager().setExcludeSuperclassListeners(excludeSuperclassListeners);
    
public voidsetIgnoreAnnotations(boolean ignoreAnnotations)
INTERNAL: Indicates that all annotations should be ignored, and only default values set by the annotations processor.

    	m_ignoreAnnotations = ignoreAnnotations;
    
public voidsetIgnoreFlags()
INTERNAL:

        m_ignoreInheritance = m_descriptor.hasInheritance();
        m_ignoreTables = m_descriptor.getTableNames().size() > 0;
        m_ignoreIDs = m_descriptor.getPrimaryKeyFieldNames().size() > 0;
    
public voidsetInheritanceStrategy(java.lang.String inheritanceStrategy)
INTERNAL: Stored on the root class of an inheritance hierarchy.

        if (inheritanceStrategy.equals(MetadataConstants.TABLE_PER_CLASS)) {
            getValidator().throwTablePerClassInheritanceNotSupported(getJavaClass());
        } else if (inheritanceStrategy.equals(MetadataConstants.SINGLE_TABLE)) {
            m_descriptor.getInheritancePolicy().setSingleTableStrategy();
        } else {
            m_descriptor.getInheritancePolicy().setJoinedStrategy();
        }
    
public voidsetIsCascadePersist(boolean isCascadePersist)
INTERNAL: Indicates that cascade-persist should be added to the set of cascade values for all relationship mappings.

    	m_isCascadePersist = isCascadePersist;
    
public voidsetIsEmbeddable()
INTERNAL:

        m_descriptor.descriptorIsAggregate();
    
public voidsetIsIsolated(boolean isIsolated)
INTERNAL:

        m_descriptor.setIsIsolated(isIsolated);
    
public voidsetJavaClass(java.lang.Class javaClass)
INTERNAL: Used to set this descriptors java class.

        m_javaClass = javaClass;
        m_descriptor.setJavaClassName(javaClass.getName());
    
protected voidsetOptimisticLockingPolicy(oracle.toplink.essentials.internal.descriptors.OptimisticLockingPolicy policy)
INTERNAL:

        m_descriptor.setOptimisticLockingPolicy(policy);
    
public voidsetPKClass(java.lang.Class pkClass)
INTERNAL:

        setPKClass(pkClass.getName());
    
public voidsetPKClass(java.lang.String pkClassName)
INTERNAL:

        CMP3Policy policy = new CMP3Policy();
        policy.setPrimaryKeyClassName(pkClassName);
        m_descriptor.setCMPPolicy(policy);
    
public voidsetParentClass(java.lang.Class parent)
INTERNAL: Set the inheritance parent class for this class.

        m_descriptor.getInheritancePolicy().setParentClassName(parent.getName());
    
public voidsetPrimaryTable(oracle.toplink.essentials.internal.helper.DatabaseTable primaryTable)
INTERNAL:

        addTable(primaryTable);
		m_primaryTableName = primaryTable.getQualifiedName();
	
public voidsetSchema(java.lang.String xmlSchema)
INTERNAL:

    	m_xmlSchema = xmlSchema;
    
public voidsetSequenceNumberField(oracle.toplink.essentials.internal.helper.DatabaseField field)
INTERNAL:

        m_descriptor.setSequenceNumberField(field);
    
public voidsetSequenceNumberName(java.lang.String name)
INTERNAL:

        m_descriptor.setSequenceNumberName(name);
    
public voidsetSingleTableInheritanceStrategy()
INTERNAL: Sets the strategy on the descriptor's inheritance policy to SINGLE_TABLE. The default is JOINED.

        m_descriptor.getInheritancePolicy().setSingleTableStrategy();
    
public voidsetUsesPropertyAccess(java.lang.Boolean usesPropertyAccess)
INTERNAL: Set the access-type while processing a class like Embeddable as it inherits the access-type from the referencing entity.

        m_usesPropertyAccess = usesPropertyAccess;
    
public voiduseTimestampLockingPolicy(oracle.toplink.essentials.internal.helper.DatabaseField field)
INTERNAL:

        useVersionLockingPolicy(new TimestampLockingPolicy(field));
    
public voiduseVersionLockingPolicy(oracle.toplink.essentials.internal.helper.DatabaseField field)
INTERNAL:

        useVersionLockingPolicy(new VersionLockingPolicy(field));
    
protected voiduseVersionLockingPolicy(oracle.toplink.essentials.descriptors.VersionLockingPolicy policy)
INTERNAL:

        policy.storeInObject();
        setOptimisticLockingPolicy(policy);
    
public booleanusesJoinedInheritanceStrategy()
INTERNAL: Indicates if the strategy on the descriptor's inheritance policy is JOINED.

        return m_descriptor.getInheritancePolicy().isJoinedStrategy();
    
public booleanusesOptimisticLocking()
INTERNAL:

        return m_descriptor.usesOptimisticLocking();
    
public booleanusesPropertyAccess()
INTERNAL: Returns true if this class uses property access. In an inheritance hierarchy, the subclasses inherit their access type from the parent. The metadata helper method caches the class access types for efficiency.

        if (m_accessor.isInheritanceSubclass()) {
            return m_accessor.getInheritanceParentDescriptor().usesPropertyAccess();
        } else {
            if (m_usesPropertyAccess == null) {
                if (MetadataHelper.havePersistenceAnnotationsDefined(MetadataHelper.getFields(getJavaClass())) || isXmlFieldAccess()) {
                    if (isXmlPropertyAccess()) {
                        // WIP - throw an exception.
                    }
                
                    // We have persistence annotations defined on a field from 
                    // the entity or field access has been set via XML, set the 
                    // access to FIELD.
                    m_usesPropertyAccess = new Boolean(false);
                } else if (MetadataHelper.havePersistenceAnnotationsDefined(MetadataHelper.getDeclaredMethods(getJavaClass())) || isXmlPropertyAccess()) {
                    if (isXmlFieldAccess()) {
                        // WIP - throw an exception.
                    }
                
                    // We have persistence annotations defined on a method from 
                    // the entity or method access has been set via XML, set the 
                    // access to PROPERTY.
                    m_usesPropertyAccess = new Boolean(true);
                } else {
                    for (ClassAccessor mappedSuperclass : getClassAccessor().getMappedSuperclasses()) {
                        if (MetadataHelper.havePersistenceAnnotationsDefined(MetadataHelper.getFields(mappedSuperclass.getJavaClass()))) {
                            // We have persistence annotations defined on a 
                            // field from a mapped superclass, set the access 
                            // to FIELD.
                            m_usesPropertyAccess = new Boolean(false);
                            break;
                        } else if (MetadataHelper.havePersistenceAnnotationsDefined(MetadataHelper.getDeclaredMethods(mappedSuperclass.getJavaClass()))) {
                            // We have persistence annotations defined on a 
                            // method from a mapped superclass, set the access 
                            // to FIELD.
                            m_usesPropertyAccess = new Boolean(true);
                            break;
                        }
                    }
                
                    // We still found nothing ... we should throw an exception 
                    // here, but for now, set the access to PROPERTY. The user 
                    // will eventually get an exception saying there is no 
                    // primary key set if property access is not actually the
                    // case.
                    if (m_usesPropertyAccess == null) {
                        m_usesPropertyAccess = new Boolean(true);
                    }
                }
            }
        
            return m_usesPropertyAccess;
        }
    
public booleanusesSingleTableInheritanceStrategy()
INTERNAL: Indicates if the strategy on the descriptor's inheritance policy is SINGLE_TABLE.

        return ! usesJoinedInheritanceStrategy();
    
public voidvalidatePKClassId(java.lang.String attributeName, java.lang.reflect.Type type)
INTERNAL: This method is used only to validate id fields that were found on a pk class were also found on the entity.

        if (m_pkClassIDs.containsKey(attributeName))  {
            Type expectedType =  m_pkClassIDs.get(attributeName);
            
            if (type == expectedType) {
                m_pkClassIDs.remove(attributeName);
            } else {
                getValidator().throwInvalidCompositePKAttribute(getJavaClass(), getPKClassName(), attributeName, expectedType, type);
            }
        }