collection tables are improperly non-quoted when the owning table is quoted

Description

None

Environment

None

Activity

Show:
Emmanuel Bernard
August 13, 2010, 10:00 AM

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.

Steve Ebersole
August 14, 2010, 2:47 AM

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.

Steve Ebersole
March 6, 2011, 3:09 PM

Discuss whether to pass Identifier from new metamodel into NamingStrategy

Steve Ebersole
March 24, 2011, 11:37 AM

This will need the new metamodel stuff at least

Steve Ebersole
April 15, 2011, 9:15 AM

I am thinking at this point that we can simply say this will be fixed by

Fixed

Assignee

Steve Ebersole

Reporter

Emmanuel Bernard

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major