'm currently working on a project that utilizes Hibernate as the ORM tool, and we have recently updated to the latest version of Hibernate (post-5.2). In our codebase, we have been using native SQL queries with the createSQLQuery method, which allowed us to use legacy-style parameters like ?. However, upon the update, we encountered the following error message:
"org.hibernate.QueryException: Legacy-style query parameters (?) are no longer supported; use JPA-style ordinal parameters (e.g., ?1)"
I understand that Hibernate deprecated createSQLQuery and recommends using JPA-style ordinal parameters. While I'm aware of this recommended approach, for the time being, I'm interested in finding alternative solutions or workarounds to keep our native queries intact as they are.
Has anyone faced a similar issue with the latest Hibernate version, and is there a way to continue using native queries with legacy-style parameters? If so, what would be the best approach to handle this situation and avoid the deprecated method?
Any insights, code examples, or suggestions would be greatly appreciated. Thank you!