jeudi 19 février 2015

Query lookup in spring data with '_' or '%' as part of the string being searched?

Is there a way to configure Spring Data to ignore characters like '_' and '%' when they are entered in the query search strings?


Right now, using the Containing keyword to make the query method. If the search keyword contains - '_' or '%', they are not treated as the characters '_' or '%'.


What is the approach if i want such characters to be treated as the characters 'as they are' - not influencing query results? I am using Spring Data JPA (1.7) with Hibernate.


Or should the escaping be done 'externally'?


Aucun commentaire:

Enregistrer un commentaire