* Create and return an {@link SelectIterator} for the class using a prepared statement.
*/
public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource,
PreparedStmt<T> preparedStmt, ObjectCache objectCache, int resultFlags) throws SQLException {
DatabaseConnection connection = connectionSource.getReadOnlyConnection();
CompiledStatement compiledStatement = null;
try {
compiledStatement = preparedStmt.compile(connection, StatementType.SELECT, resultFlags);
SelectIterator<T, ID> iterator =
new SelectIterator<T, ID>(tableInfo.getDataClass(), classDao, preparedStmt, connectionSource,
connection, compiledStatement, preparedStmt.getStatement(), objectCache);