persistence@glassfish.java.net

Re: insensitive search

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Wed, 19 Sep 2007 11:35:30 -0700

At this point I suggest to send your request to the JSR 317 (JPA 2.0) expert
group. It will be much easier if you have a portable solution.

Otherwise https://glassfish.dev.java.net/servlets/ProjectIssues is the place to
file it in GlassFish.

Regards,
-marina

Laurent Yhuel wrote:
> I use postgres and I have a native function (pl/pgsql) which I can use in
> "native query".
> I can't use this function in "named query".
>
> Actually, we have CONCAT, SUBSTRING, TRIM, LOWER, UPPER, LENGTH, LOCATE on
> String.
>
> I think function REPLACE is important too.
>
> What's url to log enhancement?
>
> Thanks
>
>
>
> -----Message d'origine-----
> De : James Sutherland [mailto:jamesssss_at_yahoo.com]
> Envoyé : mercredi 19 septembre 2007 15:42
> À : persistence_at_glassfish.dev.java.net
> Objet : Re: insensitive search
>
>
> I'm not sure if their is a database function that will remove accents, if
> there is it is probably database specific, so you will need to consult your
> database documentation. There is a function on some databases called
> REPLACE which you could use to replace each accent char with the non-accent
> char. TopLink Essentials supports this function through the Expression
> replace() API, however this function is not part of the JPA Spec so not
> accessable through JPQL (please log an enhancement request to have this
> function added to TopLink Essentials JPQL support).
>
> As a workaround you can either use a native query to make use of the REPLACE
> function uses SQL, or use a TopLink Expression in your named query instead
> of JPQL (you will need to use a SessionCustomizer to do this).
>
>
> ---
> http://wiki.java.net/bin/view/People/JamesSutherland James Sutherland
>
>
> Laurent YHUEL wrote:
>
>>Hi
>>
>>
>>
>>I have to search in a column with case insensitive and without accent.
>>
>>Exemple
>>
>>DépAssà => depassa
>>
>>
>>
>>Does it possible with named query?
>>
>>
>>
>>I view the function LOWER in named query but it’s not enough for me.
>>
>>
>>
>>Laurent
>>
>>
>>
>>
>>
>
>