FileDocCategorySizeDatePackage
PersistenceMemberElement.javaAPI DocGlassfish v2 API5083Fri May 04 22:34:42 BST 2007com.sun.jdo.api.persistence.model.jdo

PersistenceMemberElement

public abstract class PersistenceMemberElement extends PersistenceElement
author
raccah
version
%I%

Fields Summary
private PersistenceClassElement
_declaringClass
the class to which this element belongs
Constructors Summary
public PersistenceMemberElement()
Create new PersistenceMemberElement with no implementation. This constructor should only be used for cloning and archiving.

		this(null, null);
	
protected PersistenceMemberElement(Impl impl, PersistenceClassElement declaringClass)
Create new PersistenceMemberElement with the provided implementation. The implementation is responsible for storing all properties of the object.

param
impl the implementation to use
param
declaringClass the class to attach to

		super(impl);
		_declaringClass = declaringClass;
	
Methods Summary
public booleanequals(java.lang.Object obj)
Overrides PersistenceElement's equals method to add comparison of the name of the declaring class this persistence element. The method returns false if obj does not have a declaring class with the same name as this persistence element.

return
true if this object is the same as the obj argument; false otherwise.
param
obj the reference object with which to compare.

		if (super.equals(obj) && (obj instanceof PersistenceMemberElement))
		{
			PersistenceClassElement declaringClass = getDeclaringClass();
			PersistenceClassElement objDeclaringClass = 
				((PersistenceMemberElement)obj).getDeclaringClass();

			return ((declaringClass == null) ? (objDeclaringClass == null) :
				declaringClass.equals(objDeclaringClass));
		}

		return false;
	
public PersistenceClassElementgetDeclaringClass()
Get the declaring class.

return
the class that owns this member element, or null if the element is not attached to any class

		return _declaringClass;
	
final com.sun.jdo.api.persistence.model.jdo.PersistenceMemberElement$ImplgetMemberImpl()

return
the current implementation.

 return (Impl)getImpl(); 
public inthashCode()
Overrides PersistenceElement's hashCode method to add the hashCode of this persistence element's declaring class.

return
a hash code value for this object.

		PersistenceClassElement declaringClass = getDeclaringClass();

		return (super.hashCode() + 
			((declaringClass == null) ? 0 : declaringClass.hashCode()));
	
public voidsetDeclaringClass(PersistenceClassElement declaringClass)
Set the declaring class of this member element. This method should only be used internally and for cloning and archiving.

param
declaringClass the declaring class of this member element

		_declaringClass = declaringClass;