com.ibm.mm.sdk.common
Interface dkResultSetCursor
-
- All Known Implementing Classes:
- DKResultSetCursorICM
public interface dkResultSetCursorInterface for navigating and manipulating query result sets in CM8.A result set cursor provides sequential access to query results, allowing forward navigation through the result set. It supports fetching objects, updating objects in place, and deleting objects from the result set.
The cursor maintains a current position and can be opened, closed, and destroyed. It supports both object-based and name-based fetching operations.
Lifecycle:
open()- Initialize the cursor for usefetchNext()- Navigate through resultsclose()- Release resources when donedestroy()- Permanently destroy the cursor
Example usage:
dkResultSetCursor cursor = datastore.execute(query); cursor.open(); try { while (!cursor.isEnd()) { DKDDO ddo = cursor.fetchNext(); // Process the document } } finally { cursor.close(); }- See Also:
DKDDO,dkDatastore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidclose()Closes the cursor and releases associated resources.voiddeleteObject()Deletes the current object from the datastore.voiddestroy()Permanently destroys the cursor and releases all resources.DKDDOfetchNext()Fetches the next document from the result set and advances the cursor.java.lang.ObjectfetchNextByName(java.lang.String name)Fetches the next value of a specific property by name.intfetchNextNByName(java.lang.String name, int n, java.lang.Object[] result)Fetches the next N values of a specific property by name.DKDDOfetchObject()Fetches the current object without advancing the cursor position.DKDDOfindObject(int option, java.lang.String predicate)Find the data object which satisfies the given predicate.booleanisEnd()Checks if the cursor has reached the end of the result set.voidopen()Opens the cursor for use, initializing it for fetching results.voidupdateObject(DKDDO ddo)Updates the current object in the datastore with the provided DDO.
-
-
-
Method Detail
-
fetchNext
DKDDO fetchNext() throws DKException, java.lang.Exception
Fetches the next document from the result set and advances the cursor.- Returns:
- the next DKDDO object in the result set
- Throws:
DKException- if the fetch operation failsjava.lang.Exception- for other errors during fetch
-
isEnd
boolean isEnd() throws DKException, java.lang.ExceptionChecks if the cursor has reached the end of the result set.- Returns:
- true if there are no more results to fetch, false otherwise
- Throws:
DKException- if the check failsjava.lang.Exception- for other errors
-
close
void close() throws DKException, java.lang.ExceptionCloses the cursor and releases associated resources. The cursor can be reopened after closing.- Throws:
DKException- if the close operation failsjava.lang.Exception- for other errors during close
-
destroy
void destroy() throws DKException, java.lang.ExceptionPermanently destroys the cursor and releases all resources. The cursor cannot be used after destruction.- Throws:
DKException- if the destroy operation failsjava.lang.Exception- for other errors during destruction
-
open
void open() throws DKException, java.lang.Exception
Opens the cursor for use, initializing it for fetching results. Must be called before fetching operations.- Throws:
DKException- if the open operation failsjava.lang.Exception- for other errors during open
-
fetchObject
DKDDO fetchObject() throws DKException, java.lang.Exception
Fetches the current object without advancing the cursor position.- Returns:
- the current DKDDO object at the cursor position
- Throws:
DKException- if the fetch operation failsjava.lang.Exception- for other errors
-
fetchNextByName
java.lang.Object fetchNextByName(java.lang.String name) throws DKException, java.lang.ExceptionFetches the next value of a specific property by name.- Parameters:
name- the property name to fetch- Returns:
- the property value
- Throws:
DKException- if the fetch operation failsjava.lang.Exception- for other errors
-
fetchNextNByName
int fetchNextNByName(java.lang.String name, int n, java.lang.Object[] result) throws DKException, java.lang.ExceptionFetches the next N values of a specific property by name.- Parameters:
name- the property name to fetchn- the number of values to fetchresult- array to store the fetched values- Returns:
- the actual number of values fetched
- Throws:
DKException- if the fetch operation failsjava.lang.Exception- for other errors
-
deleteObject
void deleteObject() throws DKException, java.lang.ExceptionDeletes the current object from the datastore. The cursor position is advanced after deletion.- Throws:
DKException- if the delete operation failsjava.lang.Exception- for other errors
-
updateObject
void updateObject(DKDDO ddo) throws DKException, java.lang.Exception
Updates the current object in the datastore with the provided DDO.- Parameters:
ddo- the DKDDO object containing updated values- Throws:
DKException- if the update operation failsjava.lang.Exception- for other errors
-
findObject
DKDDO findObject(int option, java.lang.String predicate) throws DKException, java.lang.Exception
Find the data object which satisfies the given predicate. Moves the cursor to that position and fetches the object.- Parameters:
option- Search option/direction (e.g., DKConstant.DK_CM_CONTENT_YES)predicate- Search predicate/condition to match- Returns:
- The DKDDO object that matches the predicate, or null if not found
- Throws:
DKException- if search failsjava.lang.Exception- for other errors
-
-