Class COM.odi.util.HashPersistent

java.lang.Object
   |
   +----COM.odi.Persistent
           |
           +----COM.odi.util.HashPersistent

public class HashPersistent
extends Persistent
implements Serializable
Note: HashPersistent is deprecated. When you run the Class File Postprocessor the postprocessor causes your classes or their superclasses to inherit from COM.odi.Persistent or COM.odi.util.HashPersistent. The postprocessor chooses the superclass by examining the class being updated and any subclasses. If any of these classes are nonabstract and inherit the hashCode() method from java.lang.Object, then the postprocessor makes the COM.odi.util.HashPersistent class the superclass. Otherwise, COM.odi.Persistent becomes the superclass.

In rare situations, you might choose to explicitly define a class to inherit from HashPersistent in your source code.

All persistence-capable classes that might be used as keys in persistent hash tables should implement a refinement of hashCode() that produces the same result for the lifetime of the object. A class that inherits from this class automatically includes an identity-based hashCode() method suitable for allowing objects to serve as keys in persistent hash tables.

This class defines one persistent field.

See Also:
IPersistent

Constructor Index

 o HashPersistent()
Use this constructor when you initially construct an object.
 o HashPersistent(ClassInfo)
Use this constructor when you create a hollow object.
 o HashPersistent(int)
You can use this constructor when you create a hollow object.

Method Index

 o clearContents()
Resets the values of the fields of a persistent object to their default initial values.
 o clone()
Clones the object.
 o flushContents(GenericObject)
Stores the values of the fields of a persistent object into an instance of the GenericObject class.
 o hashCode()
Returns the hash code for the object.
 o initializeContents(GenericObject)
Initializes the values of the fields of a persistent object from data contained in a GenericObject instance.

Constructors

 o HashPersistent
  public HashPersistent()
Use this constructor when you initially construct an object.

 o HashPersistent
  protected HashPersistent(ClassInfo ignored)
Use this constructor when you create a hollow object. It is not crucial that you use this overload, but failure to do so causes extra processing.

Parameters:
ignored - Only used to distinguish this overloading. The value is not used.
 o HashPersistent
  protected HashPersistent(int ignored)
You can use this constructor when you create a hollow object. However, Object Design recommends that you use the hollow object constructor that accepts a ClassInfo argument.

This constructor is deprecated in this release. It will be removed in a future release.

Parameters:
ignored - Only used to distinguish this overloading. The value is not used.

Methods

 o initializeContents
  public void initializeContents(GenericObject genObj)
Initializes the values of the fields of a persistent object from data contained in a GenericObject instance. Subclasses must define this function and delegate to this function from within their implementation. This method causes a hollow persistent object to become an active persistent object.

Parameters:
genObj - An instance of the GenericObject class.

Overrides:
initializeContents in class Persistent
See Also:
initializeContents
 o clearContents
  public void clearContents()
Resets the values of the fields of a persistent object to their default initial values. As with initializeContents(), the method must invoke clearContents() on its superclass to ensure that all fields are correctly cleared. This method causes an active persistent object to become a hollow persistent object.

Overrides:
clearContents in class Persistent
See Also:
clearContents
 o flushContents
  public void flushContents(GenericObject genObj)
Stores the values of the fields of a persistent object into an instance of the GenericObject class. ObjectStore arranges to call this method when a modified (the Persistent.dirty() method was called on the object) persistent object is evicted. Overriding methods should write all fields, even fields that were not modified. Also, an overriding method should invoke flushContents() on its superclass.

Parameters:
genObj - An instance of the GenericObject class.

Overrides:
flushContents in class Persistent
See Also:
flushContents
 o hashCode
  public int hashCode()
Returns the hash code for the object.

Overrides:
hashCode in class Object
 o clone
  public synchronized Object clone() throws CloneNotSupportedException
Clones the object.

Returns:
The cloned object.

Throws: CloneNotSupportedException
If the subclass of HashPersistent does not implement the Cloneable interface.
Overrides:
clone in class Persistent

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.