Skip to content

Support for-each loop and forEach() for OracleCursor  #6

Description

@gvenzl

OracleCursor should be enabled to to be used in the Java for-each loop as well as the Java 8 forEach() streams implementation. The .getCursor() operation will return a cursor to self-contained OracleDocument objects. Right now the user has to write ugly boiler plate code to iterate over these documents, e.g.:

OracleCursor c = col.find().getCursor();

while (c.hasNext()) {
  OracleDocument resultDoc = c.next();
  System.out.println("Document content: " + resultDoc.getContentAsString());
}

c.close;

This should be simplified to allow the user to use the for-each construct instead:

for (OracleDocument resultDoc : col.find().getCursor()) {
  System.out.println("Document content: " + resultDoc.getContentAsString());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions