org.apache.ojb.broker
Interface ManageableCollection

All Superinterfaces:
Serializable
All Known Implementing Classes:
CollectionProxyDefaultImpl, DBagImpl, DListImpl, DSetImpl, ListProxyDefaultImpl, ManageableArrayList, ManageableHashMap, ManageableHashSet, ManageableVector, RemovalAwareCollection, RemovalAwareList, RemovalAwareSet, SetProxyDefaultImpl

public interface ManageableCollection
extends 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.1 2007-08-24 22:17:36 ewestfal Exp $
Author:
Thomas Mahler

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(Object anObject)
          Adds a single object to the Collection.
 void ojbAddAll(ManageableCollection otherCollection)
          Adds another collection to this collection.
 Iterator ojbIterator()
          Returns an iterator over all elements in the collection.
 

Method Detail

ojbAdd

void ojbAdd(Object anObject)
Adds a single object to the Collection. This method is used during reading collection elements from the database. Thus it is safe to cast the object to the underlying element type of the collection.

Parameters:
anObject - The object to add

ojbAddAll

void ojbAddAll(ManageableCollection otherCollection)
Adds another collection to this collection. Used in reading extents from the database. Thus it is safe to cast the given collection to this class.

Parameters:
otherCollection - The added collection

ojbIterator

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.

Returns:
The iterator

afterStore

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

Parameters:
broker - The persistence broker
Throws:
PersistenceBrokerException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.