query += " ORDER BY "+order;
if (pageIndex >= 0 && pageSize > 0)
query += " LIMIT "+pageIndex*pageSize+","+pageSize;
ResultSet rs = this.executeSelect(query, obj);
rs.beforeFirst();
Class<?> c = obj.getClass();
while(rs.next()) {
Object newObj = c.newInstance();
extendObject(rs, newObj);
list.add(newObj);