|
On further investigation this is probably not a sql generation issue. In my case the mismatch seems to occur as a result of generating and updating db schema outside hibernate using third party library for db schema migrations, and of course any change in column name expectations with result in errors.
But there is another issue here. I want my application to be deployable to Wildfly 8, 9, and 10. I need a configuration setting that will work the same on all versions.
If I don't specify hibernate.implicit_naming_strategy then it clearly won't work as behaviour is different on 10. If I specify hibernate.implicit_naming_strategy=legacy-jpa it will work for 10, but not for 8, and 9 as it's not a legal value for older hibernate versions. If I specify hibernate.id.new_generator_mappings=true then the behaviour would be the same in all three, but I have to fix my application so that third party lib for db migrations will use the new naming strategy.
The best option for me is non of the above - rather it is to fix all situations in my app where implicit naming is used by adding column name info to @JoinTable annotations where it's currently missing. I can then keep using
What that means is that I have no choice at all but to do changes to my application in order to remain compatible with different hibernate versions. It is a cleaner solution, but still it would be nice to be able to just specify some config option, and keep the old behaviour across old, and new versions.
|