[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-565) NamingStrategy.classToTableName receives only class name, not a fully qualified name as stated in javadoc

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Feb 23 11:53:37 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-565?page=comments#action_26252 ] 

Emmanuel Bernard commented on ANN-565:
--------------------------------------

This all came from ANN-330
Here is the problem

The spec mandate to use table name == entity name
Then entity name can be explicit or implicit (unqualified classname)

Then we have Hibernate Core that calls classToTableName if table is not null

So there is some sort of a missmatch here. 
A clean solution would be :
 - we always call tableName(entityName) since the spec "force" a table name one way or an other
  => this prevent people from using the fqcn for tables

A somewhat incoherent solution would be:
 - if entity name is implicit, then we call classToTableName(className)
 - if entity name is explicit, then we call tableName(entityName) //ie like if the table were explicit

The current solution does 
 - we always call classToTableName(entityName) which clearly is broken.

WDYT?

> NamingStrategy.classToTableName receives only class name, not a fully qualified name as stated in javadoc
> ---------------------------------------------------------------------------------------------------------
>
>          Key: ANN-565
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-565
>      Project: Hibernate Annotations
>         Type: Bug

>   Components: binder
>     Versions: 3.2.0.cr2
>     Reporter: Lóránt Pintér
>  Attachments: hibernate-annotations-3.2.1.patch.txt
>
>
> I have a custom NamingStrategy that overrides classToTableName in EJB3NamingStrategy. Prior to upgrading to Hibernate 3.1.3, my NamingStrategy implementation received the correct classnames as documented in the javadoc at http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/NamingStrategy.html#classToTableName(java.lang.String)
> Since then, it only receives the name of the class without the package specification. I tried upgrading to 3.2.0.cr2, but it didn't help.

-- 
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