I’m interested in knowing if its possible, to see on the log of queries shown by Hibernate
the class and the method that “generated” the query.
I suppose you are interested in the class and method of your service or data access layer, which is not something Hibernate can help you with since your classes are higher up the stack.
However, you can use datasource-proxy to customize the logger and append the info you want by using StackWalker to identify your classes/methods that generated that executing query.
Also, check out the MDC support of the underlying logging framework you are using. It can also help you append the info you are interested via ThreadContext variables. Check out this article for more details.