org.apache.ojb.broker
Interface ManageableCollection

All Superinterfaces:
java.io.Serializable

public interface ManageableCollection
extends java.io.Serializable

OJB can handle java.util.Collection as well as user defined collection classes as collection attributes in persistent classes. In order to collaborate with the OJB mechanisms these collection must provide a minimum protocol as defined by this interface ManageableCollection. The methods have a prefix "ojb" that indicates that these methods are "technical" methods, required by OJB and not to be used in business code.

Version:
$Id: ManageableCollection.java,v 1.5 2004/01/07 11:41:20 thma Exp $
Author:
Thomas Mahler

Field Summary
static long serialVersionUID
           
 
Method Summary
 void afterStore(PersistenceBroker broker)
          A callback method to implement 'removal-aware' (track removed objects and delete them by its own) collection implementations.
 void ojbAdd(java.lang.Object anObject)
          add a single Object to the Collection.
 void ojbAddAll(ManageableCollection otherCollection)
          adds a Collection to this collection.
 java.util.Iterator ojbIterator()
          returns an Iterator over all elements in the collection.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

ojbAdd

public void ojbAdd(java.lang.Object anObject)
add a single Object to the Collection. This method is used during reading Collection elements from the database. Thus it is is save to cast anObject to the underlying element type of the collection.


ojbAddAll

public void ojbAddAll(ManageableCollection otherCollection)
adds a Collection to this collection. Used in reading Extents from the Database. Thus it is save to cast otherCollection to this.getClass().


ojbIterator

public java.util.Iterator ojbIterator()
returns an Iterator over all elements in the collection. Used during store and delete Operations. If the implementor does not return an iterator over ALL elements, OJB cannot store and delete all elements properly.


afterStore

public void afterStore(PersistenceBroker broker)
                throws PersistenceBrokerException
A callback method to implement 'removal-aware' (track removed objects and delete them by its own) collection implementations.

Throws:
PersistenceBrokerException


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14