We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b077d64 commit c6f9186Copy full SHA for c6f9186
spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/HibernateUtils.java
@@ -48,14 +48,20 @@ public static String getHibernateQuery(Object query) {
48
49
// Try the new Hibernate implementation first
50
if (query instanceof SqmQuery sqmQuery) {
51
+
52
+ String hql = sqmQuery.getQueryString();
53
54
+ if (!hql.equals("<criteria>")) {
55
+ return hql;
56
+ }
57
58
return sqmQuery.getSqmStatement().toHqlString();
59
}
60
61
// Couple of cases in which this still breaks, see HHH-15389
62
} catch (RuntimeException o_O) {}
63
64
// Try the old way, as it still works in some cases (haven't investigated in which exactly)
-
65
if (query instanceof Query<?> hibernateQuery) {
66
return hibernateQuery.getQueryString();
67
} else {
0 commit comments