From b3b0349ebd9a1f1da2bfd1f45354b4690899bf30 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 21 Jul 2019 13:41:17 +0200 Subject: [PATCH] Fix column name escaping again --- src/main/java/fr/pandacube/java/util/orm/SQLElement.java | 2 +- src/main/java/fr/pandacube/java/util/orm/SQLElementList.java | 2 +- 2 files changed, 2 insertions(+), 2 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 15b0a46..445e37c 100644 --- a/src/main/java/fr/pandacube/java/util/orm/SQLElement.java +++ b/src/main/java/fr/pandacube/java/util/orm/SQLElement.java @@ -283,7 +283,7 @@ public abstract class SQLElement> { } first = false; concat_vals += " ? "; - concat_fields += entry.getKey().getName(); + concat_fields += "`" + entry.getKey().getName() + "`"; addValueToSQLObjectList(psValues, entry.getKey(), entry.getValue()); } 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 a82aaa9..d6df8ba 100644 --- a/src/main/java/fr/pandacube/java/util/orm/SQLElementList.java +++ b/src/main/java/fr/pandacube/java/util/orm/SQLElementList.java @@ -86,7 +86,7 @@ public class SQLElementList> extends ArrayList { List psValues = new ArrayList<>(); for (Map.Entry, Object> entry : modifiedValues.entrySet()) { - sqlSet += entry.getKey().getName() + " = ? ,"; + sqlSet += "`" + entry.getKey().getName() + "` = ? ,"; SQLElement.addValueToSQLObjectList(psValues, entry.getKey(), entry.getValue()); }