File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/provider Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,20 @@ public static String getHibernateQuery(Object query) {
4848
4949 // Try the new Hibernate implementation first
5050 if (query instanceof SqmQuery sqmQuery ) {
51+
52+ String hql = sqmQuery .getQueryString ();
53+
54+ if (!hql .equals ("<criteria>" )) {
55+ return hql ;
56+ }
57+
5158 return sqmQuery .getSqmStatement ().toHqlString ();
5259 }
5360
5461 // Couple of cases in which this still breaks, see HHH-15389
5562 } catch (RuntimeException o_O ) {}
5663
5764 // Try the old way, as it still works in some cases (haven't investigated in which exactly)
58-
5965 if (query instanceof Query <?> hibernateQuery ) {
6066 return hibernateQuery .getQueryString ();
6167 } else {
You can’t perform that action at this time.
0 commit comments