persistence@glassfish.java.net

Re: insensitive search

From: James Sutherland <jamesssss_at_yahoo.com>
Date: Wed, 19 Sep 2007 06:42:04 -0700 (PDT)

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 
> 
>  
> 
> 
> 
-- 
View this message in context: http://www.nabble.com/insensitive-search-tf4480523.html#a12777704
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.