If we can settle on smarter rules, that's of course a better outcome. Maybe something as simple as if the collection table contains only a-z A-Z 0-9 and _ we don't quote.
My initial gut feeling is that it was a a sloppy road but maybe I am wrong.
Well this illustrates a failing in the NamingStrategy contract imo. The NamingStrategy is not "clued in" to the fact that the owner table name is quoted. I mean there is just a disconnect here between the NamingStrategy and the caller.
One way to view this is that we really should not be using strings here for the names. We really should have a notion of Identifier or Name. In fact the new metamodel stuff I am working on does just this. Then the NamingStrategy could just ask the Identifier/Name if it is quoted. Of course this means a change to the contract.
Another option is to actually pass in the quoted owner table name (with the backticks). Currently we do
and pass logicalOwnerTableName in to the NamingStrategy. Instead we could do
and document the change in behavior in the migration guide.
I think you are right that any set of rules we could ever hope to apply to the code in HBMBinder is never going to work properly. That is why I said all along that imo it is not a responsibility of the HBMBinder. And you are right also about this in regards to trying to apply rules in the NamingStrategy too, provided we keep passing in the same parameter value for the ownerTableName.
Discuss whether to pass Identifier from new metamodel into NamingStrategy
This will need the new metamodel stuff at least
I am thinking at this point that we can simply say this will be fixed by