FileDocCategorySizeDatePackage
PersistentSet.javaAPI DocExample3182Mon Feb 03 07:10:18 GMT 1997imaginary.persist

PersistentSet

public abstract class PersistentSet extends imaginary.util.Observable implements RemotePersistentSet
A PersistentSet represents a group of Persistent objects based on certain query criteria.

Fields Summary
private Vector
objects
Instance attributes
Constructors Summary
public PersistentSet()
Creates a new PersistentSet.

 

      
             
        
        super();
    
Methods Summary
public synchronized voidaddPersistent(Persistent p)
Called by its peer to add a restored Persistent to the set.

param
p the Persistent to be added to the set

        if( !objects.contains(p) ) {
            objects.addElement(p);
        }
    
protected abstract PersistentSetPeergetPersistentSetPeer()
Subclasses must implement this method in order to tell this class what to use for a PersistentSetPeer.

return
the peer for this set

public synchronized RemotePersistent[]getPersistents()
Allows external objects to get a list of the Persistent objects in this set.

return
the Persistent objects in the set

        RemotePersistent[] persistents = new RemotePersistent[objects.size()];

        objects.copyInto(persistents);
        return persistents;
    
public synchronized voidrestore()
Loads the set without any query criteria. In other words, it loads all objects of a given type.

exception
imaginary.persist.PersistenceException An error occurred in accessing the database.

        Transaction t = Transaction.getTransaction();

        t.restore(this, null);
    
public synchronized voidrestore(java.util.Hashtable h)
Loads a set of persistent objects based on query criteria listed in a the Hashtable values.

param
h the values for filtering the objects of a specific type
exception
imaginary.persist.PersistenceException An error occurred in accessing the database.

        Transaction t = Transaction.getTransaction();

        t.restore(this, h);
    
public synchronized voidrestore(Transaction trans, java.util.Hashtable data)
Loads a set of persistent objects based on query criteria listed in a the Hashtable values.

param
trans the Transaction object to use for the restore
param
data the values for filtering the objects of a specific type
exception
imaginary.persist.PersistenceException An error occurred in accessing the database.

        getPersistentSetPeer().restore(this, trans, data);