Class MappingMemberElementImpl
java.lang.Object
com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
com.sun.jdo.api.persistence.model.mapping.impl.MappingMemberElementImpl
- All Implemented Interfaces:
MappingElement,MappingElementProperties,MappingMemberElement,Comparable
- Direct Known Subclasses:
MappingFieldElementImpl,MappingReferenceKeyElementImpl,MappingTableElementImpl
public abstract class MappingMemberElementImpl
extends MappingElementImpl
implements MappingMemberElement
- Version:
- %I%
- Author:
- Mark Munro, Rochelle Raccah
-
Field Summary
Fields inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElementProperties
PROP_ASSOCIATED_COLUMNS, PROP_COLUMNS, PROP_CONSISTENCY, PROP_DATABASE_ROOT, PROP_FETCH_GROUP, PROP_FIELDS, PROP_IN_CONCURRENCY_CHECK, PROP_KEY_COLUMNS, PROP_MODIFIED, PROP_NAME, PROP_NAVIGABLE, PROP_READ_ONLY, PROP_REFERENCING_KEYS, PROP_TABLE, PROP_TABLES, PROP_VERSION_FIELD -
Constructor Summary
ConstructorsConstructorDescriptionCreate new MappingMemberElementImpl with no corresponding name or declaring class.MappingMemberElementImpl(String name, MappingClassElement declaringClass) Create new MappingMemberElementImpl with the corresponding name and declaring class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanOverrides MappingElementImpl'sequalsmethod to add comparison of the name of the declaring class this mapping element.protected final voidfirePropertyChange(String name, Object o, Object n) Fires property change event.protected final voidfireVetoableChange(String name, Object o, Object n) Fires vetoable change event.Get the declaring class.inthashCode()Overrides MappingElementImpl'shashCodemethod to add the hashCode of this mapping element's declaring class.voidsetDeclaringClass(MappingClassElement declaringClass) Set the declaring class of this mapping member.Methods inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
addPropertyChangeListener, addVetoableChangeListener, compareTo, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setName, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElement
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
-
Constructor Details
-
MappingMemberElementImpl
public MappingMemberElementImpl()Create new MappingMemberElementImpl with no corresponding name or declaring class. This constructor should only be used for cloning and archiving. -
MappingMemberElementImpl
Create new MappingMemberElementImpl with the corresponding name and declaring class.- Parameters:
name- the name of the elementdeclaringClass- the class to attach to
-
-
Method Details
-
getDeclaringClass
Get the declaring class.- Specified by:
getDeclaringClassin interfaceMappingMemberElement- Returns:
- the class that owns this member element, or
nullif the element is not attached to any class
-
equals
Overrides MappingElementImpl'sequalsmethod to add comparison of the name of the declaring class this mapping element. The method returnsfalseif obj does not have a declaring class with the same name as this mapping element.- Overrides:
equalsin classMappingElementImpl- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
hashCode
public int hashCode()Overrides MappingElementImpl'shashCodemethod to add the hashCode of this mapping element's declaring class.- Overrides:
hashCodein classMappingElementImpl- Returns:
- a hash code value for this object.
-
firePropertyChange
Fires property change event. This method overrides that of MappingElementImpl to update the MappingClassElementImpl's modified status.- Overrides:
firePropertyChangein classMappingElementImpl- Parameters:
name- property nameo- old valuen- new value
-
fireVetoableChange
protected final void fireVetoableChange(String name, Object o, Object n) throws PropertyVetoException Fires vetoable change event. This method overrides that of MappingElementImpl to give listeners a chance to block changes on the mapping class element modified status.- Overrides:
fireVetoableChangein classMappingElementImpl- Parameters:
name- property nameo- old valuen- new value- Throws:
PropertyVetoException- when the change is vetoed by a listener
-
setDeclaringClass
Set the declaring class of this mapping member. This method should only be used internally and for cloning and archiving.- Parameters:
declaringClass- the declaring class of this mapping member
-