Hi,
I have the following piece of generic code that does searches for various
hibernate objects...
.....
Code:
Criteria crit = hsession.createCriteria(findObject.getClass());
Example ex = Example.create(findObject) ;
ex.enableLike();
ex.ignoreCase();
crit.add( ex );
return crit.list();
The problem is if I pass an object that has fields with characters that
have special meaning e.g. the backslash, this is not handled correctly
by the SQL generation code and thus the search fails, i.e. the backslash is not escaped using '\\\\'.
Is there some method or is there a way to tell hibernate to 'escape' the
'\' (and all the other chars that have special meaning) so that the search works correctly for the populated field in the findObject?
Thanks in advance for any help here.