HibernateUtil currently along with other characters, escapes single-quote (') character by adding a back-slash () before it. This works fine with MySQL and Oracle, but does not work with SQL Server and PostgreSQL. All DBMS work fine by escaping with ('') in strings that have single-quote i.e. they are inside "".
Thus, the escapeSqlWildcards() method should replace