Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5
Name and version of the database you are using:
SQL Server 2000 SP3
I need to escape the '_' and '%' characters in my "search" string, so that data with these characters will be found.
I cannot find a way to add an escape sequence to the query via the criteria query API (or through mapping config). If this cannot be done, then perhaps there is a way to convert a criteria query to HQL or SQL, so that I may then add my escape sequence.
This will produce SQL such as:
ResultSet rst = stmt.executeQuery("SELECT * FROM test1 WHERE col2
LIKE '\\_%' {escape '\\'}");