com.ibm.mm.sdk.common

Interface dkResultSetCursor

  • All Known Implementing Classes:
    DKResultSetCursorICM


    public interface dkResultSetCursor
    Interface 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:

    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
      void close()
      Closes the cursor and releases associated resources.
      void deleteObject()
      Deletes the current object from the datastore.
      void destroy()
      Permanently destroys the cursor and releases all resources.
      DKDDO fetchNext()
      Fetches the next document from the result set and advances the cursor.
      java.lang.Object fetchNextByName(java.lang.String name)
      Fetches the next value of a specific property by name.
      int fetchNextNByName(java.lang.String name, int n, java.lang.Object[] result)
      Fetches the next N values of a specific property by name.
      DKDDO fetchObject()
      Fetches the current object without advancing the cursor position.
      DKDDO findObject(int option, java.lang.String predicate)
      Find the data object which satisfies the given predicate.
      boolean isEnd()
      Checks if the cursor has reached the end of the result set.
      void open()
      Opens the cursor for use, initializing it for fetching results.
      void updateObject(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 fails
        java.lang.Exception - for other errors during fetch
      • isEnd

        boolean isEnd()
               throws DKException,
                      java.lang.Exception
        Checks 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 fails
        java.lang.Exception - for other errors
      • close

        void close()
            throws DKException,
                   java.lang.Exception
        Closes the cursor and releases associated resources. The cursor can be reopened after closing.
        Throws:
        DKException - if the close operation fails
        java.lang.Exception - for other errors during close
      • destroy

        void destroy()
              throws DKException,
                     java.lang.Exception
        Permanently destroys the cursor and releases all resources. The cursor cannot be used after destruction.
        Throws:
        DKException - if the destroy operation fails
        java.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 fails
        java.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 fails
        java.lang.Exception - for other errors
      • fetchNextByName

        java.lang.Object fetchNextByName(java.lang.String name)
                                  throws DKException,
                                         java.lang.Exception
        Fetches 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 fails
        java.lang.Exception - for other errors
      • fetchNextNByName

        int fetchNextNByName(java.lang.String name,
                             int n,
                             java.lang.Object[] result)
                      throws DKException,
                             java.lang.Exception
        Fetches the next N values of a specific property by name.
        Parameters:
        name - the property name to fetch
        n - the number of values to fetch
        result - array to store the fetched values
        Returns:
        the actual number of values fetched
        Throws:
        DKException - if the fetch operation fails
        java.lang.Exception - for other errors
      • deleteObject

        void deleteObject()
                   throws DKException,
                          java.lang.Exception
        Deletes the current object from the datastore. The cursor position is advanced after deletion.
        Throws:
        DKException - if the delete operation fails
        java.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 fails
        java.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 fails
        java.lang.Exception - for other errors
Copyright © 2024 IBM Corporation

Copyright © 2024 IBM Corporation. All rights reserved.