Because I don't want to have special characters like underscore to be read as wildcards but literal characters, ex:
I have this data:
index
word
1 stop
2 stap
3 st_p
If I put in my hibernate query "select * from data where word like '%st_p%' "
I only want to get the "st_p" result and not the three of them.
Currently I'm using MySQL, so the query that gets the right result looks like "select * from data where work like '%st\\\\_p%' "
In Oracle it would be "select * from data where work like '%st\\_p%' "
That's why I want to escape especial characters according to dialect.
Thanks!