Replace insane implementation with one that does not rely on the database to magically know in which order we want results returned.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2211 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -124,11 +124,16 @@ public abstract class FindAllQuery<T extends PersistentRecord>
|
|||||||
// and execute it
|
// and execute it
|
||||||
try {
|
try {
|
||||||
ResultSet rs = stmt.executeQuery();
|
ResultSet rs = stmt.executeQuery();
|
||||||
for (Key<T> key : fetchKeys) {
|
int cnt = 0;
|
||||||
if (!rs.next()) {
|
while (rs.next()) {
|
||||||
throw new SQLException("Expecting more rows in result set.");
|
T obj = _marsh.createObject(rs);
|
||||||
}
|
entities.put(_marsh.getPrimaryKey(obj), obj);
|
||||||
entities.put(key, _marsh.createObject(rs));
|
cnt ++;
|
||||||
|
}
|
||||||
|
if (cnt != fetchKeys.size()) {
|
||||||
|
throw new SQLException(
|
||||||
|
"Row count mismatch in second pass [expectedCount=" + fetchKeys.size() +
|
||||||
|
", actualCount=" + cnt + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user