This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/4_0_X by this push:
     new f6da6b0ca6 Use two singles quote to escape and fix table name on 
Persistence JPA Upgrader (#1132)
f6da6b0ca6 is described below

commit f6da6b0ca6ca9a23826648c3aadeb0c6ec7f7053
Author: Valerio Crescia <valerio.cres...@tirasa.net>
AuthorDate: Sat Jul 12 07:53:05 2025 +0200

    Use two singles quote to escape and fix table name on Persistence JPA 
Upgrader (#1132)
---
 .../core/persistence/jpa/upgrade/GenerateUpgradeSQL.java       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java
 
b/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java
index df88a1872b..790f8fb4dd 100644
--- 
a/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java
+++ 
b/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java
@@ -126,7 +126,7 @@ public class GenerateUpgradeSQL {
 
             result.append(String.format(
                     "UPDATE ExternalResource SET provisions='%s' WHERE 
id='%s';\n",
-                    MAPPER.writeValueAsString(provisions).replace("'", 
"&#39;"),
+                    MAPPER.writeValueAsString(provisions).replace("'", "''"),
                     resource.get("id").toString()));
         }
 
@@ -203,7 +203,7 @@ public class GenerateUpgradeSQL {
 
             result.append(String.format(
                     "UPDATE SyncopeRole SET anyLayout='%s' WHERE id='%s';\n",
-                    MAPPER.writeValueAsString(anyLayout).replace("'", "&#39;"),
+                    MAPPER.writeValueAsString(anyLayout).replace("'", "''"),
                     role.get("id").toString()));
         }
 
@@ -295,7 +295,7 @@ public class GenerateUpgradeSQL {
 
                 result.append(String.format(
                         "UPDATE AnyTemplateRealm SET template='%s' WHERE 
id='%s';\n",
-                        MAPPER.writeValueAsString(t).replace("'", "&#39;"),
+                        MAPPER.writeValueAsString(t).replace("'", "''"),
                         template.get("id").toString()));
             }
         }
@@ -310,7 +310,7 @@ public class GenerateUpgradeSQL {
 
                 result.append(String.format(
                         "UPDATE AnyTemplatePullTask SET template='%s' WHERE 
id='%s';\n",
-                        MAPPER.writeValueAsString(t).replace("'", "&#39;"),
+                        MAPPER.writeValueAsString(t).replace("'", "''"),
                         template.get("id").toString()));
             }
         }
@@ -325,7 +325,7 @@ public class GenerateUpgradeSQL {
                 "SELECT id from AuditConf");
 
         auditConf.forEach(conf -> result.append(String.format(
-                "UPDATE SyncopeRole SET id='%s' WHERE id='%s';\n",
+                "UPDATE AuditConf SET id='%s' WHERE id='%s';\n",
                 conf.get("id").toString().replace("syncope.audit.", ""),
                 conf.get("id").toString())));
 

Reply via email to