I’m using spring boot and spring data jpa 2.7 version for developing our service.
I would like to add every jpa query method when jpa makes sql query without any annotation.
In my version, if I want to add query comment in jpa, I have to use like this,
@QueryHints({
@QueryHint(name = org.hibernate.annotations.QueryHints.COMMENT, value = "userRepository.findAll")
})
In 3.2 version, We can use like this,
@Meta("userRepository.findAll")
I just want to add query comment without any annotation.
Instead, I want to add query comment as “their method name”.
Because, when slow query is occurred, our dba would let us which query is slow.
But our service has so many queries so we don’t know where query is using in our codes.
So we decide to add every query comment in our codes like “/* findByUserId */”.
I couldn’t find these kind of option in jpa.
I wonder whether spring data jpa team is going to add global query hint feature in jpa.
If they are not going to add this feature, I’m going to make this feature for my team developers.
Please let me know if you guys has same issue or has solution to solve this problem.
Thank you!
I just want to add query comment to every sql query in our service.
Harry is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.