https://hibernate.atlassian.net/browse/HHH-15736 (merge request https://github.com/hibernate/hibernate-orm/pull/5746 ) introduced a regression for LIKE-queries in H2 databases running in ORACLE-compatibility mode. Setting escape '' successfully disables the escape character if running H2 in its default configuration. However, when running H2 in Oracle compatibility mode, H2 fails to return any results. I opened an issue with H2 (https://github.com/h2database/h2database/issues/3745 ), and it seems users are advised against attempting to use escape ‘' in Oracle-compatibility mode. But starting with hibernate 6.1.7, this possibly illegal use of escape '' is now the default behaviour. Workaround: Explicitly set a non-null escape character for LIKE-expressions, so the newly introduced special case does not get executed. Possible solution: Detect whether H2 is running in Oracle Compatibility Mode, and skip the newly introduced special case then. |