[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6087) AuditJoinTable does not default to a concatenation of the primary table names, as stated in Doumentation

Robin Gersabeck (JIRA) noreply at atlassian.com
Wed Apr 6 10:35:00 EDT 2011


AuditJoinTable does not default to a concatenation of the primary table names, as stated in Doumentation
--------------------------------------------------------------------------------------------------------

                 Key: HHH-6087
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6087
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.6.2, 3.5.6
         Environment: Oracle
            Reporter: Robin Gersabeck
            Priority: Minor


The Documentation at http://docs.jboss.org/envers/api-new/org/hibernate/envers/AuditJoinTable.html states that the AuditJoinTable "defaults to a concatenation of the names of the primary table of the entity owning the association and of the primary table of the entity referenced by the association."

Instead, the default is the concatenation of the two entities' class names. The behavior described in the documentation is preferable to the actual behavior, since it's easy for two concatenated class names to result in an AuditJoinTable name over 30 characters, which Oracle does not support.

The relevant part of the code can be found in CollectionMetadataGenerator.java:272 in Hibernate 3.6.2:
{quote} 
return StringTools.getLastComponent(entityName) + "_" + StringTools.getLastComponent(MappingTools.getReferencedEntityName(value.getElement()));
{quote} 

I figured out how to make the second part of the concatenation use the proper table name (but I did not figure out how to also fix the first part yet):
{quote} 
return StringTools.getLastComponent(entityName) + "_" + value.getElement().getTable().getName();
{quote} 

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