- if (theAdaptor.hasLimit()) {
- rs = executeSql(stmt, countSql.toString());
- if (rs != null) {
- if (rs.next())
- count = rs.getInt(1);
- rs.close();
- //nothing in the table: return null
- if(count<=0){
- freeConnection(con, stmt);
- return null;
- }
- } else {
- theLog.printError("Could not count: " + countSql);
- }
- }
+
+ /** @todo select count(*) should be optimized:
+ * 1. it should take place after select statement because in some
+ * cases it is not necessary anymore.
+ * 2. it is only needed if entitylist needs information about how
+ * many datasets there are overall
+ *
+ * optimization:
+ *
+ * if we manage to have the full information about allData already
+ * with the select statement, then we set it in entitylist, other
+ * wise we fetch it. /rk
+ * */
+
+