org.apache.ojb.broker
Interface ManageableCollection

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CollectionProxyDefaultImpl, ListProxyDefaultImpl, ManageableArrayList, ManageableHashMap, ManageableHashSet, ManageableVector, RemovalAwareCollection, RemovalAwareList, RemovalAwareSet, SetProxyDefaultImpl

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 365231 2005-12-21 22:22:08Z tomdz $
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(java.lang.Object anObject)
          Adds a single object to the Collection.
 void ojbAddAll(ManageableCollection otherCollection)
          Adds another collection to this collection.
 java.util.Iterator ojbIterator()
          Returns an iterator over all elements in the collection.
 

Method Detail

ojbAdd

void ojbAdd(java.lang.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

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.

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


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30