com.odi
Class Persistent

java.lang.Object
  |
  +--com.odi.Persistent
All Implemented Interfaces:
IPersistent, IPersistentHooks
Direct Known Subclasses:
HashPersistent, UnregisteredType

Deprecated. 

public abstract class Persistent
extends java.lang.Object
implements IPersistent, IPersistentHooks

In previous releases, to be persistence-capable, a class had to extend Persistent or HashPersistent. In this release, to be persistence-capable, a class or its superclass must implement the IPersistent interface.

A class whose instances can be stored in a database is considered to be a persistence-capable class.

Normally, to define a persistence-capable class, you run the Class File Postprocessor to annotate your class so that it implements IPersistent. In rare situations, you can explicitly define your class to implement IPersistent and the methods it defines. See IPersistent for more details on the interface and the methods it requires.


Method Summary
protected  java.lang.Object clone()
          Deprecated. Clones the persistence-capable object.
 void postInitializeContents()
          Deprecated. Called by ObjectStore immediately after calling the initializeContents() method.
 void preClearContents()
          Deprecated. Called by ObjectStore immediately before calling the clearContents() method.
 void preDestroyPersistent()
          Deprecated. Hook for ObjectStore.destroy(object).
 void preFlushContents()
          Deprecated. Called by ObjectStore immediately before calling the flushContents() method.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.odi.IPersistent
clearContents, flushContents, initializeContents, ODIgetRef, ODIgetState, ODIsetRef, ODIsetState
 

Method Detail

postInitializeContents

public void postInitializeContents()
Deprecated. 
Called by ObjectStore immediately after calling the initializeContents() method. Implement this method when you want to customize behavior.

This method must not call any methods of the class and must not start or end a transaction. For more information, see Implementing Customized Methods and Hook Methods in Chapter 9 of the API User Guide.

Specified by:
postInitializeContents in interface IPersistentHooks

preFlushContents

public void preFlushContents()
Deprecated. 
Called by ObjectStore immediately before calling the flushContents() method. Implement this method when you want to customize behavior.

This method must not call any methods of the class and must not start or end a transaction. For more information, see Implementing Customized Methods and Hook Methods in Chapter 9 of the API User Guide.

Specified by:
preFlushContents in interface IPersistentHooks

preClearContents

public void preClearContents()
Deprecated. 
Called by ObjectStore immediately before calling the clearContents() method. Implement this method when you want to customize behavior, typically to clear transient-only fields to permit the objects to be garbage collected.

This method must not call any methods of the class and must not start or end a transaction. For more information, see Implementing Customized Methods and Hook Methods in Chapter 9 of the API User Guide.

Specified by:
preClearContents in interface IPersistentHooks

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Deprecated. 
Clones the persistence-capable object. The object itself must have been fetched, since it is meaningless to clone an object when it has no contents. The clone is always initially transient, but it can become persistent by the usual persistence mechanisms.
Overrides:
clone in class java.lang.Object
Returns:
The cloned object.
Throws:
java.lang.CloneNotSupportedException - If the subclass of Persistent does not implement the Cloneable interface.

preDestroyPersistent

public void preDestroyPersistent()
Deprecated. 
Hook for ObjectStore.destroy(object). If ObjectStore.destroy(object) is called on an object, this method is called before the object argument is actually destroyed. A user class may override this method in order to destroy any internal persistent data structures that it references. For example, if a user "Btree" class has internal persistent types representing the leaves of the tree which are not visible via its API, the Btree.preDestroyPersistent method may be defined to remove those leaves from the database. Btree.preDestroyPersistent should not call ObjectStore.destroy(this).

The default implementation of this method does nothing.

Specified by:
preDestroyPersistent in interface IPersistentHooks


Copyright 2004 Progress Software Corporation. All rights reserved.