net.sourceforge.floggy.persistence
Interface SingleObjectSet

All Superinterfaces:
ObjectSet

public interface SingleObjectSet
extends ObjectSet

An interface representing a search result. The ObjectSet logically maintains a sequence of the object's IDs. It is possible to iterate over all objects (or a subset, if an optional object filter has been supplied) using the get(int index) method.

PersistableManager pm = PersistableManager.getInstance();
ObjectSet os = manager.find(Customer.class, null, null);
for(int i = 0; i < os.size(); i++) {
  Customer customer = (Customer) os.get(i);
  ...
}


By using an optional Filter, only the objects that matches the provided filter will be avaiable in this set.

By using an optional Comparator, the order of the objects in this set will be determined by the comparator.

Since:
1.4.0
See Also:
PersistableManager.find(Class, Filter, Comparator), Filter, Comparator

Method Summary
 void get(int index, Persistable object)
          Deprecated. Use the getSharedInstance instead of it.
 int getId(int index)
          Load the object of a given index into the object instance supplied.
 
Methods inherited from interface net.sourceforge.floggy.persistence.ObjectSet
get, getSharedInstance, isLazy, setLazy, size
 

Method Detail

get

void get(int index,
         Persistable object)
         throws FloggyException
Deprecated. Use the getSharedInstance instead of it.

Load the object of a given index into the object instance.

Parameters:
index - Index of the object to be loaded.
object - An instance of the object to be loaded. It cannot be null.
Throws:
FloggyException - Exception thrown if a persistance error occurs.

getId

int getId(int index)
          throws FloggyException
Load the object of a given index into the object instance supplied.

Parameters:
index - Index of the object to be loaded.
Returns:
The id number at RMS system at the specified position in the set.
Throws:
FloggyException - Exception thrown if a persistance error occurs.


Copyright © 2006-2011 Floggy Open Source Group. All Rights Reserved.