Jay Xu commented on Sub-task HHH-6521

Hi

Is this issue fixed in 4.1.7? I met some issues seems related to this one.

I wrote UTs using derby but the DDL failed if the column name is a SQL keyword. e.g.

"org.hibernate.tool.hbm2ddl.SchemaUpdate:235 - HHH000388: Unsuccessful: create table redemption_requests (id integer generated by default as identity, amount numeric(16,2) not null, operateDate timestamp, partial boolean not null, redemptionType varchar(32) not null, rejectionCause clob(255), requestDate timestamp not null, reservedAmount numeric(16,2) not null, state varchar(32) not null, targetDay date not null, userID varchar(36) not null, version integer not null, product_id integer not null, primary key (id))
org.hibernate.tool.hbm2ddl.SchemaUpdate:236 - Syntax error: Encountered "partial" at line 6, column 9."

seems that the column name is not escaped correctly.

I look into the source code of org.hibernate.mapping.Table(4.1.7) and found some code may be the cause:

/**

  • returns quoted name as it would be in the mapping file.
    */
    public String getQuotedName() { return quoted ? "`" + name + "`" : name; }

when I trying to find out the places invoking org.hibernate.mapping.Table.setQuoted(boolean) that possibly changes "quoted" to true, there is nowhere

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira