On 21/11/2016 13:47, Adrian Gonzalez wrote:
Hi Francesco,

Cool, I've just created SYNCOPE-971.

> the problem is that, as far as I can tell, such clauses are DBMS-dependent.
We can solve it using jpql LOWER ou UPPER function, i.e.
LOWER(givenName) = LOWER('Martin')

I can try to implement it, but I don't know for now if it is possible to introduce either : * custom operator in FIQL (i.e. some eqi operator like : givenName eqi Martin)
 * introduce custom functions in FIQL (i.e. uc(givenName) == uc(Martin))

I would rather go with first (we also have other custom operators).

Essentially, I see two separate tasks here:

1. extend FIQL, the query builders and the logic that transforms FIQL queries into the low-level search objects 2. extend JPAAnySearchDAO to take care of such new EQI comparator, similarly to what is currently done at

https://github.com/apache/syncope/blob/2_0_X/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java#L782-L790

The only non-obvious problem I see is that we will need to make the new code RDBMS provider dependent.

Regards.

------------------------------------------------------------------------
*De :* Francesco Chicchiriccò <[email protected]>
*À :* [email protected]
*Envoyé le :* Lundi 21 novembre 2016 13h25
*Objet :* Re: User case insensitive search



On 21/11/2016 12:59, Adrian Gonzalez wrote:
Hello,

I'd like to execute a case insensitive search in Syncope.

i.e. querying all users with an attribute givenName that matches 'martin' would return :
Martin
martin
mArtin

Is there a way to do this with a Fiql search ?
i.e. something like UPPER(givenName) = UPPER('martin') ?

If no are there other ways to do this ?
If no, I can always store givenName attribute in 2 different attributes (i.e. the real givenName attribute and a givenNameCaseInsensitive attribute to store it in lowercase), but I would like to avoid it if possible.

Hi Adrian,
I confirm that currently it is *not* possible to perform case insensitive searches.

Nevertheless, it would be a nice feature to add: essentially, one should be adding 'lowercase()' clauses to the native SQL queries manage by [1]: the problem is that, as far as I can tell, such clauses are DBMS-dependent.

Would you mind creating an improvement on JIRA for this?
Naturally, contributions are welcome ;-)

Regards.

[1] https://github.com/apache/syncope/blob/2_0_X/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to