Hello, I hope you have a nice day!
I want to add some optimization hints to a statement. Specifically a JOIN ORDER for MySQL. To do that, I used
typedQuery.unwrap(org.hibernate.query.Query.class).addQueryHint("/*+ JOIN_ORDER(" + String.join(",", List.of("t1", "t2")) + ") */");
to add a query hint, and built a custom Dialect to insert that hint at the correct place in the statement. The only problem left is that I do not know the aliases Hinbernate uses for the joined tables. Is there a way to find those out?
I’m using Hibernate 7.3.1.Final, if that’s relevant.