}
}
columnValues.add(new PersistentValue(pf.getColumnName(), pf.getSqlType(), newVersionValue));
}
else {
throw new InvalidDataAccessApiUsageException("Invalid type for version column. Must be of type Number.");
}
}
else {
columnValues.add(new PersistentValue(pf.getColumnName(), pf.getSqlType(), r));
}
}
} catch (NoSuchMethodException e1) {
throw new DataAccessResourceFailureException(new StringBuffer().append("Failed to map field ").append(pf.getFieldName()).append(".").toString(), e1);
} catch (IllegalAccessException e1) {
throw new DataAccessResourceFailureException(new StringBuffer().append("Failed to map field ").append(pf.getFieldName()).append(".").toString(), e1);
} catch (InvocationTargetException e1) {
throw new DataAccessResourceFailureException(new StringBuffer().append("Failed to map field ").append(pf.getFieldName()).append(".").toString(), e1);
}
}
else {
unmappedFields.put(pf.getFieldName(), pf);
}
}
List additionalColumnValues = completeMappingOnSave(o, mappedFields, unmappedFields);
for (Iterator iter = additionalColumnValues.iterator(); iter.hasNext(); ) {
Object colVal = iter.next();
if (colVal instanceof PersistentValue) {
if (((PersistentValue)colVal).isIdValue())
idValues.add(colVal);
else
columnValues.add(colVal);
}
else {
throw new InvalidDataAccessApiUsageException("Invalid type returned for additional columns. Must be of type PersistentValue.");
}
}
if (persistentObject.isDependentObject()) {
StringBuffer cntSql = new StringBuffer();
cntSql.append("select count(*) from ").append(tableNameToUse);