org.apache.ojb.broker.util.collections
Class RemovalAwareSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet
org.apache.ojb.broker.util.collections.ManageableHashSet
org.apache.ojb.broker.util.collections.RemovalAwareSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, Set, ManageableCollection, IRemovalAwareCollection
public class RemovalAwareSet
- extends ManageableHashSet
- implements IRemovalAwareCollection
This is a set implementation that tracks removal and addition of elements.
This tracking allow the PersistenceBroker to delete elements from
the database that have been removed from the collection before a
PB.store() orperation occurs.
This will allow to use the PB api in way pretty close to ODMG persistent
collections!
- Version:
- $Id: RemovalAwareSet.java,v 1.1 2007-08-24 22:17:39 ewestfal Exp $
- Author:
- Thomas Dudziak
- See Also:
- Serialized Form
RemovalAwareSet
public RemovalAwareSet()
afterStore
public void afterStore(PersistenceBroker broker)
throws PersistenceBrokerException
- Description copied from interface:
ManageableCollection
- A callback method to implement 'removal-aware' (track removed objects and delete
them by its own) collection implementations.
- Specified by:
afterStore
in interface ManageableCollection
- Overrides:
afterStore
in class ManageableHashSet
- Parameters:
broker
- The persistence broker
- Throws:
PersistenceBrokerException
- See Also:
ManageableCollection.afterStore(PersistenceBroker broker)
registerForDeletion
protected void registerForDeletion(Object toBeRemoved)
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection
- Specified by:
remove
in interface Set
- Overrides:
remove
in class HashSet
- See Also:
Collection.remove(Object)
removeAllElements
public void removeAllElements()
- See Also:
Vector.removeAllElements()
clear
public void clear()
- Specified by:
clear
in interface Collection
- Specified by:
clear
in interface Set
- Overrides:
clear
in class HashSet
resetDeleted
public void resetDeleted()
Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.