Top Description Fields Constructors Methods
org.hibernate.internal

public final Class IteratorImpl

extends Object
implements HibernateIterator
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.HibernateIterator, java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, java.util.NoSuchElementException, org.hibernate.HibernateException, .JDBCException, org.hibernate.engine.HibernateIterator, org.hibernate.engine.jdbc.spi.JdbcCoordinator, org.hibernate.event.spi.EventSource, org.hibernate.hql.internal.HolderInstantiator, org.hibernate.type.EntityType, .Type

An implementation of java.util.Iterator that is returned by iterate() query execution methods.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private Object
private boolean
private HolderInstantiator
private static final CoreMessageLogger
private final String[][]
private PreparedStatement
private boolean
private ResultSet
private final EventSource
session

Deprecated as a consequence of EventSource being deprecated.
private final boolean
private final Type[]

Constructor Summary

AccessConstructor and Description
public
IteratorImpl(ResultSet rs, PreparedStatement ps, EventSource sess, boolean readOnly, Type[] types, String[][] columnNames, HolderInstantiator holderInstantiator)

Deprecated as a consequence of EventSource being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.hibernate.engine.HibernateIterator.close.

Close the Hibernate query result iterator
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public Object
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
private void
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentResultback to summary
private Object currentResult
hasNextback to summary
private boolean hasNext
holderInstantiatorback to summary
private HolderInstantiator holderInstantiator
LOGback to summary
private static final CoreMessageLogger LOG
namesback to summary
private final String[][] names
psback to summary
private PreparedStatement ps
readOnlyback to summary
private boolean readOnly
rsback to summary
private ResultSet rs
sessionback to summary
private final EventSource session

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

singleback to summary
private final boolean single
typesback to summary
private final Type[] types

Constructor Detail

IteratorImplback to summary
public IteratorImpl(ResultSet rs, PreparedStatement ps, EventSource sess, boolean readOnly, Type[] types, String[][] columnNames, HolderInstantiator holderInstantiator) throws HibernateException, SQLException

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

Method Detail

closeback to summary
public void close() throws JDBCException

Implements org.hibernate.engine.HibernateIterator.close.

Doc from org.hibernate.engine.HibernateIterator.close.

Close the Hibernate query result iterator

Exceptions
JDBCException:
Indicates a problem releasing the underlying JDBC resources.
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

nextback to summary
public Object next() throws HibernateException

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:Object

the next element in the iteration

postNextback to summary
private void postNext() throws SQLException
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.