private void postNext() throws HibernateException, SQLException {
this.hasNext = rs.next();
if (!hasNext) {
log.debug("exhausted results");
close();
}
else {
log.debug("retrieving next results");
boolean isHolder = holderInstantiator.isRequired();
if ( single && !isHolder ) {
nextResult = types[0].nullSafeGet( rs, names[0], session, null );
}
else {
Object[] nextResults = new Object[types.length];
for (int i=0; i<types.length; i++) {
nextResults[i] = types[i].nullSafeGet( rs, names[i], session, null );
}
if (isHolder) {
nextResult = holderInstantiator.instantiate(nextResults);
}
else {
nextResult = nextResults;
}
}
}
}