syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-1382] improves string check conditions
Date Thu, 11 Oct 2018 08:15:54 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X dd09c8a20 -> f092044c4


[SYNCOPE-1382] improves string check conditions


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4242ae52
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4242ae52
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4242ae52

Branch: refs/heads/2_0_X
Commit: 4242ae52944ae764b1613b83a943c017c95879da
Parents: dd09c8a
Author: fmartelli <fabio.martelli@gmail.com>
Authored: Thu Oct 11 10:15:21 2018 +0200
Committer: fmartelli <fabio.martelli@gmail.com>
Committed: Thu Oct 11 10:15:21 2018 +0200

----------------------------------------------------------------------
 .../syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/4242ae52/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
index 3dbca69..90e5fd0 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
@@ -680,7 +680,7 @@ public class JPAAnySearchDAO extends AbstractAnySearchDAO {
         boolean ignoreCase = AttributeCond.Type.ILIKE == cond.getType() || AttributeCond.Type.IEQ
== cond.getType();
 
         String column = (cond instanceof AnyCond) ? cond.getSchema() : svs.fieldName(schema.getType());
-        if (ignoreCase) {
+        if ((schema.getType() == AttrSchemaType.String || schema.getType() == AttrSchemaType.Enum)
&& ignoreCase) {
             column = "LOWER (" + column + ")";
         }
         if (!(cond instanceof AnyCond)) {
@@ -731,7 +731,8 @@ public class JPAAnySearchDAO extends AbstractAnySearchDAO {
                 } else {
                     query.append('=');
                 }
-                if (ignoreCase) {
+                if ((schema.getType() == AttrSchemaType.String 
+                        || schema.getType() == AttrSchemaType.Enum) && ignoreCase)
{
                     query.append("LOWER(?").append(setParameter(parameters, attrValue.getValue())).append(')');
                 } else {
                     query.append('?').append(setParameter(parameters, attrValue.getValue()));


Mime
View raw message