org.apache.ojb.broker.util.collections
Class RemovalAwareSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
org.apache.ojb.broker.util.collections.ManageableHashSet
org.apache.ojb.broker.util.collections.RemovalAwareSet
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, IRemovalAwareCollection, ManageableCollection, java.io.Serializable, java.util.Set
- 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 365232 2005-12-21 22:36:07Z tomdz $
- Author:
- Thomas Dudziak
- See Also:
- Serialized Form
Methods inherited from class java.util.HashSet |
add, clone, contains, isEmpty, iterator, size |
Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
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
- Throws:
PersistenceBrokerException
- See Also:
ManageableCollection.afterStore(PersistenceBroker broker)
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interface java.util.Set
- See Also:
Collection.remove(Object)
removeAllElements
public void removeAllElements()
- See Also:
Vector.removeAllElements()
clear
public void clear()
- Specified by:
clear
in interface java.util.Set
resetDeleted
public void resetDeleted()
(C) 2002 - 2005 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