org.exolab.castor.jdo

Interface Persistent

public interface Persistent

A callback informs objects about changes to their state.

Version: $Revision: 1.2 $ $Date: 2005/04/17 10:29:22 $

Author: Assaf Arkin

Method Summary
voidjdoAfterCreate()
Called to indicate that an object has been created in persistent storage.
voidjdoAfterRemove()
Called to indicate that an object has been removed from persistent storage.
voidjdoBeforeCreate(Database db)
Called to indicate that an object is to be created in persistent storage.
voidjdoBeforeRemove()
Called to indicate that an object is to be removed from persistent storage.
ClassjdoLoad(AccessMode accessMode)
Called to indicate that the object has been loaded from persistent storage.
voidjdoPersistent(Database db)
Called to set the database to which this object belongs when this object becomes persistent.
voidjdoStore(boolean modified)
Called to indicate that an object is to be stored in persistent storage.
voidjdoTransient()
Called to indicate the object is now transient.
voidjdoUpdate()
Called to indicate that an object has been included to the current transaction by means of db.update() method (at the end of a "long " transaction).

Method Detail

jdoAfterCreate

public void jdoAfterCreate()
Called to indicate that an object has been created in persistent storage. This method is called during db.create().

jdoAfterRemove

public void jdoAfterRemove()
Called to indicate that an object has been removed from persistent storage. This method is called during db.remove().

jdoBeforeCreate

public void jdoBeforeCreate(Database db)
Called to indicate that an object is to be created in persistent storage. This method is called during db.create().

Parameters: db The database in which this object will be created

jdoBeforeRemove

public void jdoBeforeRemove()
Called to indicate that an object is to be removed from persistent storage. This method is called during db.remove().

jdoLoad

public Class jdoLoad(AccessMode accessMode)
Called to indicate that the object has been loaded from persistent storage. This method is called immediately after synchronizing an object with the database.

Parameters: accessMode The access mode that was specified for this object either in OQLQuery, or in Database. The constants are defined in Database.

Returns: the return value is discarded

Throws: Exception An exception occured, the object cannot be loaded

jdoPersistent

public void jdoPersistent(Database db)
Called to set the database to which this object belongs when this object becomes persistent. The object may use the database to load/create/delete related objects.

Called when the object is first created as the result of a query, perior to calling Persistent, or after Database has been called on the object, prior to calling Persistent.

Parameters: db The database to which this object belongs

jdoStore

public void jdoStore(boolean modified)
Called to indicate that an object is to be stored in persistent storage. This method is called at commit time on all persistent objects in this transaction. Managed fields may not necessarily be persisted if the object has not been identified as modified.

Parameters: modified Is the object modified?

Throws: Exception An exception occured, the object cannot be stored

jdoTransient

public void jdoTransient()
Called to indicate the object is now transient. The object may no longer use the database object assigned to it, and will become hollow with various fields set to null.

Called when the object #setFacetscompletes following any call to Persistent or when the object is deleted from the database.

jdoUpdate

public void jdoUpdate()
Called to indicate that an object has been included to the current transaction by means of db.update() method (at the end of a "long " transaction).

Throws: Exception An exception occured, the object cannot be stored

Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com