alba lion
alba lion

Reputation: 93

how to uniquely identify an hibernate sql query

What's the easiest way to uniquely identify an Hibernate SQLQuery (https://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/SQLQuery.html) once it has been created and all it's parameters bound?

I've found this to generate a query key: http://docs.jboss.org/hibernate/orm/4.2/javadocs/org/hibernate/cache/spi/QueryKey.html. But, that does not appear to be usable outside of hibernate internals.

Upvotes: 1

Views: 140

Answers (1)

Vlad Mihalcea
Vlad Mihalcea

Reputation: 154090

You can use a @NamedNativeQuery to uniquely identify an SQLQuery.

Upvotes: 1

Related Questions