Fixed bug in SQLElementList

This commit is contained in:
Marc Baloup 2017-11-08 01:56:37 +01:00
parent 304d957fa1
commit dfa098a22d
2 changed files with 1 additions and 7 deletions

View File

@ -291,7 +291,7 @@ public abstract class SQLElement<E extends SQLElement<E>> {
} }
@SuppressWarnings("rawtypes") @SuppressWarnings({ "rawtypes", "unchecked" })
protected static <E extends SQLElement<E>> void addValueToSQLObjectList(List<Object> list, SQLField<E, ?> field, Object jValue) throws ORMException { protected static <E extends SQLElement<E>> void addValueToSQLObjectList(List<Object> list, SQLField<E, ?> field, Object jValue) throws ORMException {
if (jValue != null && field.type instanceof SQLCustomType) { if (jValue != null && field.type instanceof SQLCustomType) {
try { try {

View File

@ -88,12 +88,6 @@ public class SQLElementList<E extends SQLElement<E>> extends ArrayList<E> {
for (Map.Entry<SQLField<E, ?>, Object> entry : modifiedValues.entrySet()) { for (Map.Entry<SQLField<E, ?>, Object> entry : modifiedValues.entrySet()) {
sqlSet += entry.getKey().getName() + " = ? ,"; sqlSet += entry.getKey().getName() + " = ? ,";
SQLElement.addValueToSQLObjectList(psValues, entry.getKey(), entry.getValue()); SQLElement.addValueToSQLObjectList(psValues, entry.getKey(), entry.getValue());
if (entry.getKey().type.getJavaType().isEnum()) {
// prise en charge enum (non prise en charge par JDBC)
psValues.add(((Enum<?>) entry.getValue()).name());
}
else
psValues.add(entry.getValue());
} }
if (sqlSet.length() > 0) sqlSet = sqlSet.substring(0, sqlSet.length() - 1); if (sqlSet.length() > 0) sqlSet = sqlSet.substring(0, sqlSet.length() - 1);