@Override public boolean hasNext() { return scrollableCursor != null && scrollableCursor.hasNext(); }
/** * PUBLIC: * Indicates whether the cursor can move to the the next row */ public boolean hasMoreElements() throws DatabaseException { return hasNext(); }
/** * PUBLIC: * Indicates whether the cursor can move to the the next row */ public boolean hasMoreElements() throws DatabaseException { return hasNext(); }
/** * PUBLIC: * Indicates whether the cursor can move to the the next row */ public boolean hasNextElement() throws DatabaseException { return hasNext(); }
/** * PUBLIC: * Indicates whether the cursor can move to the the next row */ public boolean hasNextElement() throws DatabaseException { return hasNext(); }
/** * PUBLIC: * Indicates whether the cursor can move to the the next row */ public boolean hasNextElement() throws DatabaseException { return hasNext(); }
/** * PUBLIC: * Indicates whether the cursor can move to the the next row */ public boolean hasMoreElements() throws DatabaseException { return hasNext(); }
@Override public boolean hasNext() { return scrollableCursor != null && scrollableCursor.hasNext(); }
ReadAllQuery query = new ReadAllQuery(); query.setReferenceClass(Employee.class); query.setSelectionCriteria(new ExpressionBuilder.get("id").greaterThan(100)); // Set the JDBC fetch size query.setFetchSize(50); // Configure the query to return results as a ScrollableCursor query.useScrollableCursor(); // Execute the query ScrollableCursor cursor = (ScrollableCursor) session.executeQuery(query); // Iterate over the results while (cursor.hasNext()) { System.out.println(cursor.next().toString()); } cursor.close();
/** * Retrieve next object from the scrollable cursor */ public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectNext = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasNext()) { objectNext = stream.next(); } if (objectNext == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectNext)); } } transporter.setObject(objectNext); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve next object from the scrollable cursor */ public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectNext = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasNext()) { objectNext = stream.next(); } if (objectNext == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectNext)); } } transporter.setObject(objectNext); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve next object from the scrollable cursor */ public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectNext = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasNext()) { objectNext = stream.next(); } if (objectNext == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectNext)); } } transporter.setObject(objectNext); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }