The fact that you're using Spring 3.2.2 tells me that you're running, at least, Java 11. As you have identified, you need to update Hibernate, which also means you need to update Spring. To be honest, if you're not maintaining versions in your application, you are doing yourself a disservice because you will likely be open to unpatched
critical vulnerabilities[
^].