try {
delegate.beginTransaction();
rs = delegate.getResults(0, 1);
- boolean resultExists = rs.next();
rsmd = rs.getMetaData();
+ boolean resultExists = rs.next();
Class<?> type = null;
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
if (!isColumnIdentifierValid(rsmd.getColumnLabel(i))) {
Assert.assertEquals(name, name3);
}
+
+ @Test
+ public void ticket10032_empty_set_metadata_correctly_handled()
+ throws SQLException {
+ // If problem exists will break when method getPropertyIds()
+ // is called in constructor SQLContainer(QueryDelegate delegate).
+ SQLContainer container = new SQLContainer(new FreeformQuery(
+ "SELECT * FROM people WHERE name='does_not_exist'",
+ Arrays.asList("ID"), connectionPool));
+ Assert.assertTrue("Got items while expected empty set",
+ container.size() == 0);
+ }
}