Methods Summary |
---|
public void | addAccessor(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 void | addAggregateDescriptor(oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor aggregateDescriptor)INTERNAL:
m_aggregateDescriptors.add(aggregateDescriptor);
|
public void | addAssociationOverride(java.lang.String attributeName, oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataJoinColumns joinColumns)INTERNAL:
m_associationOverrides.put(attributeName, joinColumns);
|
public void | addAttributeOverride(oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataColumn column)INTERNAL:
m_attributeOverrides.put(column.getAttributeName(), column);
|
public void | addClassIndicator(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 void | addDefaultEventListener(oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener listener)INTERNAL:
m_descriptor.getEventManager().addDefaultEventListener(listener);
|
public void | addEntityListenerEventListener(oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener listener)INTERNAL:
m_descriptor.getEventManager().addEntityListenerEventListener(listener);
|
public void | addIdAttributeName(java.lang.String idAttributeName)INTERNAL:
m_idAttributeNames.add(idAttributeName);
|
public void | addMapping(oracle.toplink.essentials.mappings.DatabaseMapping mapping)INTERNAL:
m_descriptor.addMapping(mapping);
|
public void | addMultipleTableForeignKeyField(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 void | addMultipleTablePrimaryKeyField(oracle.toplink.essentials.internal.helper.DatabaseField pkField, oracle.toplink.essentials.internal.helper.DatabaseField fkField)INTERNAL:
m_descriptor.addMultipleTablePrimaryKeyField(pkField, fkField);
|
public void | addPKClassId(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 void | addPrimaryKeyField(oracle.toplink.essentials.internal.helper.DatabaseField field)INTERNAL:
m_descriptor.addPrimaryKeyField(field);
|
public void | addTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)INTERNAL:
m_descriptor.addTable(table);
|
public boolean | excludeSuperclassListeners()INTERNAL:
return m_descriptor.getEventManager().excludeSuperclassListeners();
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor | getAccessorFor(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.String | getAlias()INTERNAL:
return m_descriptor.getAlias();
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataJoinColumns | getAssociationOverrideFor(java.lang.String attributeName)INTERNAL:
return m_associationOverrides.get(attributeName);
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataColumn | getAttributeOverrideFor(java.lang.String attributeName)INTERNAL:
return m_attributeOverrides.get(attributeName);
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor | getBiDirectionalManyToManyAccessor(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.String | getCatalog()INTERNAL:
return m_xmlCatalog;
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor | getClassAccessor()INTERNAL:
return m_accessor;
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getClassDescriptor()INTERNAL:
return m_descriptor;
|
public oracle.toplink.essentials.internal.helper.DatabaseField | getClassIndicatorField()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.String | getDefaultTableName()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.String | getEmbeddedIdAttributeName()INTERNAL:
return m_embeddedIdAttributeName;
|
public java.lang.String | getIdAttributeName()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.List | getIdAttributeNames()INTERNAL:
Return the id attribute names declared on this descriptor metadata.
return m_idAttributeNames;
|
public java.util.List | getIdOrderByAttributeNames()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.Class | getJavaClass()INTERNAL:
return m_javaClass;
|
public java.lang.String | getJavaClassName()INTERNAL:
return m_descriptor.getJavaClassName();
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataLogger | getLogger()INTERNAL:
return getClassAccessor().getLogger();
|
public oracle.toplink.essentials.mappings.DatabaseMapping | getMappingForAttributeName(java.lang.String attributeName)INTERNAL:
return getMappingForAttributeName(attributeName, null);
|
public oracle.toplink.essentials.mappings.DatabaseMapping | getMappingForAttributeName(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.List | getMappings()INTERNAL:
return m_descriptor.getMappings();
|
public java.util.List | getOrderByAttributeNames()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
if (m_orderByAttributeNames.isEmpty()) {
for (DatabaseMapping mapping : getMappings()) {
if (mapping.isDirectToFieldMapping()) {
m_orderByAttributeNames.add(mapping.getAttributeName());
}
}
}
return m_orderByAttributeNames;
|
public java.lang.String | getPKClassName()INTERNAL:
String pkClassName = null;
if (m_descriptor.hasCMPPolicy()) {
pkClassName = ((CMP3Policy) m_descriptor.getCMPPolicy()).getPKClassName();
}
return pkClassName;
|
public java.lang.String | getPrimaryKeyFieldName()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.List | getPrimaryKeyFieldNames()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.List | getPrimaryKeyFields()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.String | getPrimaryKeyJoinColumnAssociation(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.String | getPrimaryKeyTableName()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.String | getPrimaryTableName()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.MetadataProject | getProject()INTERNAL:
return getClassAccessor().getProject();
|
public java.util.Collection | getRelationshipAccessors()INTERNAL:
return m_relationshipAccessors.values();
|
public java.lang.String | getSchema()INTERNAL:
return m_xmlSchema;
|
public oracle.toplink.essentials.internal.helper.DatabaseField | getSequenceNumberField()INTERNAL:
return m_descriptor.getSequenceNumberField();
|
public oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidator | getValidator()INTERNAL:
return getClassAccessor().getValidator();
|
public boolean | hasAssociationOverrideFor(java.lang.String attributeName)INTERNAL:
return m_associationOverrides.containsKey(attributeName);
|
public boolean | hasAttributeOverrideFor(java.lang.String attributeName)INTERNAL:
return m_attributeOverrides.containsKey(attributeName);
|
public boolean | hasBiDirectionalManyToManyAccessorFor(java.lang.String className, java.lang.String attributeName)INTERNAL:
if (m_biDirectionalManyToManyAccessors.containsKey(className)) {
return m_biDirectionalManyToManyAccessors.get(className).containsKey(attributeName);
}
return false;
|
public boolean | hasCompositePrimaryKey()INTERNAL:
return getPrimaryKeyFields().size() > 1 || getPKClassName() != null;
|
public boolean | hasEmbeddedIdAttribute()INTERNAL:
return m_embeddedIdAttributeName != null;
|
public boolean | hasInheritance()INTERNAL:
return m_descriptor.hasInheritance();
|
public boolean | hasMappingForAttributeName(java.lang.String attributeName)INTERNAL:
return m_descriptor.getMappingForAttributeName(attributeName) != null;
|
public boolean | hasPrimaryKeyFields()INTERNAL:
Return true is the descriptor has primary key fields set.
return m_descriptor.getPrimaryKeyFields().size() > 0;
|
public boolean | ignoreAnnotations()INTERNAL:
Indicates whether or not annotations should be ignored, i.e. only default
values processed.
return m_ignoreAnnotations;
|
public boolean | ignoreIDs()INTERNAL:
return m_ignoreIDs;
|
public boolean | ignoreInheritance()INTERNAL:
return m_ignoreInheritance;
|
public boolean | ignoreTables()INTERNAL:
return m_ignoreTables;
|
private void | init()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 boolean | isCascadePersist()INTERNAL:
Indicates that cascade-persist should be applied to all relationship
mappings for this entity.
return m_isCascadePersist;
|
public boolean | isEmbeddable()INTERNAL:
return m_descriptor.isAggregateDescriptor();
|
public boolean | isEmbeddableCollection()INTERNAL:
return m_descriptor.isAggregateCollectionDescriptor();
|
public boolean | isXmlFieldAccess()INTERNAL:
Indicates that we found an XML field access type for this metadata
descriptor.
return m_xmlAccess.equals(XMLConstants.FIELD);
|
public boolean | isXmlPropertyAccess()INTERNAL:
Indicates that we found an XML property access type for this metadata
descriptor.
return m_xmlAccess.equals(XMLConstants.PROPERTY);
|
public boolean | pkClassWasNotValidated()INTERNAL:
return ! m_pkClassIDs.isEmpty();
|
public void | setAccess(java.lang.String access)INTERNAL:
m_xmlAccess = access;
|
public void | setAlias(java.lang.String alias)INTERNAL:
m_descriptor.setAlias(alias);
|
public void | setCatalog(java.lang.String xmlCatalog)INTERNAL:
m_xmlCatalog = xmlCatalog;
|
public void | setClassAccessor(oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor accessor)INTERNAL:
m_accessor = accessor;
|
public void | setClassIndicatorField(oracle.toplink.essentials.internal.helper.DatabaseField field)INTERNAL:
m_descriptor.getInheritancePolicy().setClassIndicatorField(field);
|
public void | setDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)INTERNAL:
m_descriptor = descriptor;
|
public void | setEmbeddedIdAttributeName(java.lang.String embeddedIdAttributeName)INTERNAL:
m_embeddedIdAttributeName = embeddedIdAttributeName;
|
public void | setEntityEventListener(oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener listener)INTERNAL:
m_descriptor.getEventManager().setEntityEventListener(listener);
|
public void | setExcludeDefaultListeners(boolean excludeDefaultListeners)INTERNAL:
m_descriptor.getEventManager().setExcludeDefaultListeners(excludeDefaultListeners);
|
public void | setExcludeSuperclassListeners(boolean excludeSuperclassListeners)INTERNAL:
m_descriptor.getEventManager().setExcludeSuperclassListeners(excludeSuperclassListeners);
|
public void | setIgnoreAnnotations(boolean ignoreAnnotations)INTERNAL:
Indicates that all annotations should be ignored, and only default values
set by the annotations processor.
m_ignoreAnnotations = ignoreAnnotations;
|
public void | setIgnoreFlags()INTERNAL:
m_ignoreInheritance = m_descriptor.hasInheritance();
m_ignoreTables = m_descriptor.getTableNames().size() > 0;
m_ignoreIDs = m_descriptor.getPrimaryKeyFieldNames().size() > 0;
|
public void | setInheritanceStrategy(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 void | setIsCascadePersist(boolean isCascadePersist)INTERNAL:
Indicates that cascade-persist should be added to the set of cascade
values for all relationship mappings.
m_isCascadePersist = isCascadePersist;
|
public void | setIsEmbeddable()INTERNAL:
m_descriptor.descriptorIsAggregate();
|
public void | setIsIsolated(boolean isIsolated)INTERNAL:
m_descriptor.setIsIsolated(isIsolated);
|
public void | setJavaClass(java.lang.Class javaClass)INTERNAL:
Used to set this descriptors java class.
m_javaClass = javaClass;
m_descriptor.setJavaClassName(javaClass.getName());
|
protected void | setOptimisticLockingPolicy(oracle.toplink.essentials.internal.descriptors.OptimisticLockingPolicy policy)INTERNAL:
m_descriptor.setOptimisticLockingPolicy(policy);
|
public void | setPKClass(java.lang.Class pkClass)INTERNAL:
setPKClass(pkClass.getName());
|
public void | setPKClass(java.lang.String pkClassName)INTERNAL:
CMP3Policy policy = new CMP3Policy();
policy.setPrimaryKeyClassName(pkClassName);
m_descriptor.setCMPPolicy(policy);
|
public void | setParentClass(java.lang.Class parent)INTERNAL:
Set the inheritance parent class for this class.
m_descriptor.getInheritancePolicy().setParentClassName(parent.getName());
|
public void | setPrimaryTable(oracle.toplink.essentials.internal.helper.DatabaseTable primaryTable)INTERNAL:
addTable(primaryTable);
m_primaryTableName = primaryTable.getQualifiedName();
|
public void | setSchema(java.lang.String xmlSchema)INTERNAL:
m_xmlSchema = xmlSchema;
|
public void | setSequenceNumberField(oracle.toplink.essentials.internal.helper.DatabaseField field)INTERNAL:
m_descriptor.setSequenceNumberField(field);
|
public void | setSequenceNumberName(java.lang.String name)INTERNAL:
m_descriptor.setSequenceNumberName(name);
|
public void | setSingleTableInheritanceStrategy()INTERNAL:
Sets the strategy on the descriptor's inheritance policy to SINGLE_TABLE.
The default is JOINED.
m_descriptor.getInheritancePolicy().setSingleTableStrategy();
|
public void | setUsesPropertyAccess(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 void | useTimestampLockingPolicy(oracle.toplink.essentials.internal.helper.DatabaseField field)INTERNAL:
useVersionLockingPolicy(new TimestampLockingPolicy(field));
|
public void | useVersionLockingPolicy(oracle.toplink.essentials.internal.helper.DatabaseField field)INTERNAL:
useVersionLockingPolicy(new VersionLockingPolicy(field));
|
protected void | useVersionLockingPolicy(oracle.toplink.essentials.descriptors.VersionLockingPolicy policy)INTERNAL:
policy.storeInObject();
setOptimisticLockingPolicy(policy);
|
public boolean | usesJoinedInheritanceStrategy()INTERNAL:
Indicates if the strategy on the descriptor's inheritance policy is
JOINED.
return m_descriptor.getInheritancePolicy().isJoinedStrategy();
|
public boolean | usesOptimisticLocking()INTERNAL:
return m_descriptor.usesOptimisticLocking();
|
public boolean | usesPropertyAccess()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 boolean | usesSingleTableInheritanceStrategy()INTERNAL:
Indicates if the strategy on the descriptor's inheritance policy is
SINGLE_TABLE.
return ! usesJoinedInheritanceStrategy();
|
public void | validatePKClassId(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);
}
}
|