From dfa098a22daa3104cfc18f274420cb0db17ab0c5 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Wed, 8 Nov 2017 01:56:37 +0100 Subject: [PATCH] Fixed bug in SQLElementList --- src/main/java/fr/pandacube/java/util/orm/SQLElement.java | 2 +- .../java/fr/pandacube/java/util/orm/SQLElementList.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/fr/pandacube/java/util/orm/SQLElement.java b/src/main/java/fr/pandacube/java/util/orm/SQLElement.java index d5fdd4c..08d1e4a 100644 --- a/src/main/java/fr/pandacube/java/util/orm/SQLElement.java +++ b/src/main/java/fr/pandacube/java/util/orm/SQLElement.java @@ -291,7 +291,7 @@ public abstract class SQLElement> { } - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "unchecked" }) protected static > void addValueToSQLObjectList(List list, SQLField field, Object jValue) throws ORMException { if (jValue != null && field.type instanceof SQLCustomType) { try { diff --git a/src/main/java/fr/pandacube/java/util/orm/SQLElementList.java b/src/main/java/fr/pandacube/java/util/orm/SQLElementList.java index c066b02..b3eab1d 100644 --- a/src/main/java/fr/pandacube/java/util/orm/SQLElementList.java +++ b/src/main/java/fr/pandacube/java/util/orm/SQLElementList.java @@ -88,12 +88,6 @@ public class SQLElementList> extends ArrayList { for (Map.Entry, Object> entry : modifiedValues.entrySet()) { sqlSet += entry.getKey().getName() + " = ? ,"; 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);