[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5428) collection tables are improperly non-quoted when the owning table is quoted

Steve Ebersole (JIRA) noreply at atlassian.com
Fri Aug 13 10:47:41 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38070#action_38070 ] 

Steve Ebersole commented on HHH-5428:
-------------------------------------

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
{code}
String logicalOwnerTableName = ownerTable.getName();
{code}
and pass {{logicalOwnerTableName}} in to the {{NamingStrategy}}.  Instead we could do
{code}
String logicalOwnerTableName = ownerTable.getQuotedName();
{code}
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.

> collection tables are improperly non-quoted when the owning table is quoted
> ---------------------------------------------------------------------------
>
>                 Key: HHH-5428
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5428
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.5.4, 3.6.0.Beta1
>            Reporter: Emmanuel Bernard
>             Fix For: 3.6.0.Beta3
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list