return new MapperDataIterator<Postgres9Entity, UserImage>(mapper, entityDao.getIterator((Postgres9Connection) con));
}
@Override
public List<String> findIdsByUserId(PartakeConnection con, String userId, int offset, int limit) throws DAOException {
Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
"SELECT id FROM " + USER_INDEX_TABLE_NAME + " WHERE userId = ? ORDER BY createdAt DESC OFFSET ? LIMIT ?",
new Object[] { userId, offset, limit });
ArrayList<String> result = new ArrayList<String>();
try {
ResultSet rs = psars.getResultSet();
while (rs.next())
result.add(rs.getString(1));
} catch (SQLException e) {
throw new DAOException(e);
} finally {
psars.close();
}
return result;
}