Issue Type: Bug Bug
Assignee: Unassigned
Created: 18/Dec/12 3:14 AM
Description:

hbm2ddl quotes column type, but it shouldn't:

<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.globally_quoted_identifiers" value="false" />
<property name="hibernate.show_sql" value="false" />

@Entity @Table(name="release")
public class Release implements Serializable, IHasTraits {

    @Temporal(TemporalType.DATE)
    @Column(columnDefinition="TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", insertable=false, updatable=false)
    private Date lastChanged = new Date();
}

Results in

create table `release` (... `lastChanged` `TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP`, ...

The column definition being quoted results in MySQL parse error.

Actually, the other types in that CREATE query are not quoted. Probably there is some wrong assumption that type which contains spaces must be quoted. But here it's `columnDefinition`, not a type name. Hence IMO this usage is legal, and quoting is wrong.

When `hibernate.globally_quoted_identifiers=false`, the the definition is not quoted as it should. (But then, in this example, `release` will cause trouble as it is MySQL keyword, but that's different story.)

Project: Hibernate ORM
Priority: Major Major
Reporter: Ondra Žižka
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