[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2303) generateTemporaryTableName in Oracle9Dialect does not truncate well

Francois Jean (JIRA) noreply at atlassian.com
Tue Dec 12 13:58:05 EST 2006


generateTemporaryTableName in Oracle9Dialect does not truncate well
-------------------------------------------------------------------

         Key: HHH-2303
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2303
     Project: Hibernate3
        Type: Patch

  Components: core  
    Versions: 3.2.0.ga    
 Environment: Hibernate 3.2, Oracle database
    Reporter: Francois Jean
    Priority: Minor
 Attachments: substring.patch

In "org.hibernate.dialect.Oracle9Dialect" the method used to truncate the temporary table name removes the first character of the table name. I think that we should retain the first character. Using "name.substring( 0, 30 )" will return 30 character which should be ok for Oracle.

I propose to change this method:
public String generateTemporaryTableName(String baseTableName) {
		String name = super.generateTemporaryTableName(baseTableName);
		return name.length() > 30 ? name.substring( 1, 30 ) : name;
	}

For:
public String generateTemporaryTableName(String baseTableName) {
		String name = super.generateTemporaryTableName(baseTableName);
		return name.length() > 30 ? name.substring( 0, 30 ) : name;
	}


François J.


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