This is an automated email from the ASF dual-hosted git repository.
andreapatricelli pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_1_X by this push:
new 1d66d86 adding parenthesis to perform the correct query while
searching by plainAttrValue
1d66d86 is described below
commit 1d66d86f2e963799ebde5b099578543e2d02e085
Author: Andrea Patricelli <[email protected]>
AuthorDate: Thu Jul 1 16:22:00 2021 +0200
adding parenthesis to perform the correct query while searching by
plainAttrValue
---
.../org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
index 1edc88f..8da2119 100644
---
a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
+++
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
@@ -189,7 +189,7 @@ public abstract class AbstractAnyDAO<A extends Any<?>>
extends AbstractDAO<A> im
private Query findByPlainAttrValueQuery(final String entityName, final
boolean ignoreCaseMatch) {
String query = "SELECT e FROM " + entityName + " e"
- + " WHERE e.attribute.schema.id = :schemaKey AND
(e.stringValue IS NOT NULL"
+ + " WHERE e.attribute.schema.id = :schemaKey AND
((e.stringValue IS NOT NULL"
+ " AND "
+ (ignoreCaseMatch ? "LOWER(" : "") + "e.stringValue" +
(ignoreCaseMatch ? ")" : "")
+ " = "
@@ -197,7 +197,7 @@ public abstract class AbstractAnyDAO<A extends Any<?>>
extends AbstractDAO<A> im
+ " OR (e.booleanValue IS NOT NULL AND e.booleanValue =
:booleanValue)"
+ " OR (e.dateValue IS NOT NULL AND e.dateValue = :dateValue)"
+ " OR (e.longValue IS NOT NULL AND e.longValue = :longValue)"
- + " OR (e.doubleValue IS NOT NULL AND e.doubleValue =
:doubleValue)";
+ + " OR (e.doubleValue IS NOT NULL AND e.doubleValue =
:doubleValue))";
return entityManager().createQuery(query);
}