ps.executeUpdate();
if (idVal == null && !classInfo.generatedKeys.isEmpty()) {
ResultSet gk = ps.getGeneratedKeys();
if (!gk.next())
throw new SienaException("No such generated keys");
i = 1;
for (Field field : classInfo.generatedKeys) {
field.setAccessible(true);
JdbcMappingUtils.setFromObject(obj, field, gk.getObject(i));
// field.set(obj, gk.getObject(i));
i++;
}
}
} catch (SienaException e) {
throw e;
} catch (Exception e) {
throw new SienaException(e);
} finally {
JdbcDBUtils.closeStatementAndConnection(this, ps);
}
}