Skip to content

Commit

Permalink
Fetch HQL from Hibernate using a different API.
Browse files Browse the repository at this point in the history
See #3085
  • Loading branch information
gregturn committed Sep 7, 2023
1 parent 778b481 commit 5780245
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ public static String getHibernateQuery(Object query) {

// Try the new Hibernate implementation first
if (query instanceof SqmQuery sqmQuery) {
return sqmQuery.getSqmStatement().toHqlString();

String hql = sqmQuery.getQueryString();

if (!hql.equals("<criteria>")) {
return hql;
}

String sqmHql = sqmQuery.getSqmStatement().toHqlString();

This comment has been minimized.

Copy link
@mp911de

mp911de Sep 8, 2023

Member

Nit: Could be inlined


return sqmHql;
}

// Couple of cases in which this still breaks, see HHH-15389
Expand Down

0 comments on commit 5780245

Please sign in to comment.