org.ephman.abra.database
Class DatabaseCursor
java.lang.Object
org.ephman.abra.database.DatabaseCursor
- All Implemented Interfaces:
- java.io.Serializable
- public class DatabaseCursor
- extends java.lang.Object
- implements java.io.Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
theFactory
GenericFactoryBase theFactory
lastOid
int lastOid
increment
int increment
theSearsh
public QueryFilter theSearsh
searchResults
int[] searchResults
hitCount
int hitCount
originalSort
public SortCriteria originalSort
DatabaseCursor
public DatabaseCursor(GenericFactoryBase theFactory,
java.util.Vector hits,
QueryFilter searsh,
SortCriteria originalSort,
int hitCount,
int increment)
- construct a database cursor which contains a Vector of all the items hit
in the last search.
- Parameters:
theFactory
- where further lookups should be directedhits
- a list of oids that corresponds to the hitssearsh
- the query which produced this list (mostly for tracking)increment
- a default increment for the nextObjects method
DatabaseCursor
public DatabaseCursor(GenericFactoryBase theFactory,
java.util.Vector hits,
QueryFilter searsh,
SortCriteria originalSort,
int hit_count)
getOidFromSearchResults
public int getOidFromSearchResults(int i)
- Return the i-th Oid in the result of the cursor. If the index "i" is out of
range, then 0 is returned - which is not a valid oid.
- Parameters:
i
- index of the oid to retrieve
- Returns:
- the i-th oid, or 0 if the index is out of range
getHitCount
public int getHitCount()
refreshSearch
public void refreshSearch(DatabaseSession dbSess)
throws java.sql.SQLException
- a routine to refresh the cursor (in case of stale data)
- Parameters:
dbSess
- a session to use..
- Throws:
java.sql.SQLException
getObjects
public java.util.Vector getObjects(DatabaseSession dbSess,
int start,
int count)
throws java.sql.SQLException
- a routine to get a sub-set of objects from the last query
- Parameters:
dbSess
- the database Sessionstart
- the initial index (the Java way 0 - (size-1))count
- the maximum number of items to be retrieved (less if not that many available)
- Returns:
- Vector of the objects returned from the Factory..
- Throws:
java.sql.SQLException
- if an error occurs while talking to the database
getNextObjects
public java.util.Vector getNextObjects(DatabaseSession dbSess)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getNextObjects
public java.util.Vector getNextObjects(DatabaseSession dbSess,
SortCriteria sc)
throws java.sql.SQLException
- Throws:
java.sql.SQLException