| |
|
| java.lang.Object org.jaffa.persistence.engines.jdbcengine.datasource.DataSourceCursor
DataSourceCursor | public class DataSourceCursor implements Collection(Code) | | This class gives a Collection view of a ResultSet. Each row of the ResultSet is molded into an appropriate Persistent object and added to the Collection.
The rows are fetched in groups. The size of each group is determined by the 'hitlistSize' parameter of the init.xml for a particular database definition.
On creation, the 1st group of rows are fetched. Use the Iterator (a custom implementation), to fetch all the rows. The Collection interface methods will only on the fetched data.
The size() method will return a negative value, unless all the data has been fetched.
|
Method Summary | |
public boolean | add(Object obj) Ensures that this collection contains the specified element.
Note: This will not add any data to the Persistent store.
Parameters: obj - element whose presence in this collection is to be ensured. | public boolean | addAll(Collection collection) Adds all of the elements in the specified collection to this collection.
Note: This will not add any data to the Persistent store.
Parameters: collection - elements to be inserted into this collection. | public void | clear() Removes all of the elements from this collection. | public boolean | contains(Object obj) Returns true if this collection contains the specified element.
Note: This will only check the data that has been fetched so far.
Parameters: obj - element whose presence in this collection is to be tested. | public boolean | containsAll(Collection collection) Returns true if this collection contains all of the elements in the specified collection.
Note: This will only check the data that has been fetched so far.
Parameters: collection - collection to be checked for containment in this collection. | public boolean | isEmpty() Returns true if this collection contains no elements. | public Iterator | iterator() Returns a custom iterator. | public boolean | remove(Object obj) Removes a single instance of the specified element from this collection, if it is present.
Note: This will not remove any data from the Persistent store. | public boolean | removeAll(Collection collection) Removes all this collection's elements that are also contained in the specified collection.
Note: This will not remove any data from the Persistent store. | public boolean | retainAll(Collection collection) Retains only the elements in this collection that are contained in the specified collection.
Note: This will not remove any data from the Persistent store. | public int | size() Returns the number of elements in this collection. | public Object[] | toArray() Returns an array containing all of the elements in this collection. | public Object[] | toArray(Object[] obj) Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
Note: This will only return the data that has been fetched so far.
Parameters: obj - the array into which the elements of this collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. |
DataSourceCursor | DataSourceCursor(DataSource dataSource, ResultSet resultSet, ClassMetaData classMetaData, Criteria criteria) throws SQLException, PostLoadFailedException, DataSourceCursorRuntimeException, IOException(Code) | | Creates new DataSourceCursor. It loads the initial set of rows.
Parameters: dataSource - the DataSource object which will be creating this object. Parameters: resultSet - the ResultSet from which the data is to be loded. Parameters: classMetaData - the ClassMetaData definition to be used for molding a row into a Persistent object. Parameters: criteria - The Criteria used for the query. This will provide the values to set the various flags on the Persistent object. throws: SQLException - if any database error occurs. throws: PostLoadFailedException - if any error is thrown in the PostLoad trigger of the persistent object. throws: DataSourceCursorRuntimeException - if any error occurs while molding the row into the Persistent object. throws: IOException - if any error occurs in reading the data from the database. |
add | public boolean add(Object obj)(Code) | | Ensures that this collection contains the specified element.
Note: This will not add any data to the Persistent store.
Parameters: obj - element whose presence in this collection is to be ensured. true if this collection changed as a result of the call. |
addAll | public boolean addAll(Collection collection)(Code) | | Adds all of the elements in the specified collection to this collection.
Note: This will not add any data to the Persistent store.
Parameters: collection - elements to be inserted into this collection. true if this collection changed as a result of the call. |
contains | public boolean contains(Object obj)(Code) | | Returns true if this collection contains the specified element.
Note: This will only check the data that has been fetched so far.
Parameters: obj - element whose presence in this collection is to be tested. true if this collection contains the specified element. |
containsAll | public boolean containsAll(Collection collection)(Code) | | Returns true if this collection contains all of the elements in the specified collection.
Note: This will only check the data that has been fetched so far.
Parameters: collection - collection to be checked for containment in this collection. true if this collection contains all of the elements in the specified collection. |
isEmpty | public boolean isEmpty()(Code) | | Returns true if this collection contains no elements. However, a 'true' does not mean that
there is no more data to be fetched; since it is possible that the fetched elements could have been removed by the remove() methods.
true if this collection contains no elements. |
iterator | public Iterator iterator()(Code) | | Returns a custom iterator. Use the iterator for fetching all the rows.
an iterator over the elements in this collection. |
remove | public boolean remove(Object obj)(Code) | | Removes a single instance of the specified element from this collection, if it is present.
Note: This will not remove any data from the Persistent store. This will only check the data that has been fetched so far.
Parameters: obj - element to be removed from this collection, if present. true if this collection changed as a result of the call. |
removeAll | public boolean removeAll(Collection collection)(Code) | | Removes all this collection's elements that are also contained in the specified collection.
Note: This will not remove any data from the Persistent store. This will only check the data that has been fetched so far.
Parameters: collection - elements to be removed from this collection. true if this collection changed as a result of the call. |
retainAll | public boolean retainAll(Collection collection)(Code) | | Retains only the elements in this collection that are contained in the specified collection.
Note: This will not remove any data from the Persistent store. This will only check the data that has been fetched so far.
Parameters: collection - elements to be retained in this collection. true if this collection changed as a result of the call. |
size | public int size()(Code) | | Returns the number of elements in this collection.
Note: This will return a negative number, if all the data has not been fetched.
the number of elements in this collection; |
toArray | public Object[] toArray()(Code) | | Returns an array containing all of the elements in this collection.
Note: This will only return the data that has been fetched so far.
an array containing all of the elements in this collection. |
toArray | public Object[] toArray(Object[] obj)(Code) | | Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
Note: This will only return the data that has been fetched so far.
Parameters: obj - the array into which the elements of this collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. an array containing the elements of this collection. |
|
|
|