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
Constructors Constructor Description MappingMemberElementImpl()
Create 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Overrides MappingElementImpl'sequals
method to add comparison of the name of the declaring class this mapping element.protected void
firePropertyChange(String name, Object o, Object n)
Fires property change event.protected void
fireVetoableChange(String name, Object o, Object n)
Fires vetoable change event.MappingClassElement
getDeclaringClass()
Get the declaring class.int
hashCode()
Overrides MappingElementImpl'shashCode
method to add the hashCode of this mapping element's declaring class.void
setDeclaringClass(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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElement
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
-
-
-
-
Constructor Detail
-
MappingMemberElementImpl
public MappingMemberElementImpl()
Create new MappingMemberElementImpl with no corresponding name or declaring class. This constructor should only be used for cloning and archiving.
-
MappingMemberElementImpl
public MappingMemberElementImpl(String name, MappingClassElement declaringClass)
Create new MappingMemberElementImpl with the corresponding name and declaring class.- Parameters:
name
- the name of the elementdeclaringClass
- the class to attach to
-
-
Method Detail
-
getDeclaringClass
public MappingClassElement getDeclaringClass()
Get the declaring class.- Specified by:
getDeclaringClass
in interfaceMappingMemberElement
- Returns:
- the class that owns this member element, or
null
if the element is not attached to any class
-
equals
public boolean equals(Object obj)
Overrides MappingElementImpl'sequals
method to add comparison of the name of the declaring class this mapping element. The method returnsfalse
if obj does not have a declaring class with the same name as this mapping element.- Overrides:
equals
in classMappingElementImpl
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCode
public int hashCode()
Overrides MappingElementImpl'shashCode
method to add the hashCode of this mapping element's declaring class.- Overrides:
hashCode
in classMappingElementImpl
- Returns:
- a hash code value for this object.
-
firePropertyChange
protected final void firePropertyChange(String name, Object o, Object n)
Fires property change event. This method overrides that of MappingElementImpl to update the MappingClassElementImpl's modified status.- Overrides:
firePropertyChange
in 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:
fireVetoableChange
in classMappingElementImpl
- Parameters:
name
- property nameo
- old valuen
- new value- Throws:
PropertyVetoException
- when the change is vetoed by a listener
-
setDeclaringClass
public void setDeclaringClass(MappingClassElement declaringClass)
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
-
-