Get dialect from session (for character escaping)
843859Nov 30 2009 — edited Dec 1 2009Hi all,
First of all, I'm aware this is not the right place for hibernate questions, but hibernate forums are broken and this this forum is all I have for the time being.
I'm using hibernate and I need to get the dialect being used in order to make some special characters escape, I need to use different escape technique depending upon the dialect.
For example, for mysql I need to escape underscore like this:
query.replaceAll("_", "\\\\_")
for Oracle and HSQL I need to do like this:
query.replaceAll("_", "\\_")
That's why I need to infer the dialect from the org.hibernate.Session, but I just can't see how to do it with the available JavaDocs.
Thanks a lot!