Joined: Thu Jun 22, 2006 4:44 am Posts: 1 Location: milano, italia
|
Moving from Derby to production db MySQL 5.0 we encounter errors while creating entity tables.
In details it seems that hibernate generates the sql statement for tables creation with some problems in the primary key specification.
MySql does not like primary key definition at the end of the "create table" statement. We tried using org.hibernate.dialect.MySQL5Dialect and org.hibernate.dialect.MySQLDialect with no effects.
Hibernate version: 3.2.0.cr2 Hibernate annotation version: 3.2.0.cr1
Name and version of the database you are using: MySQL 5.0 Connector: mysql-connector-java version 3.1.13
Hibernate Conf: hibernate.connection.driver=com.mysql.jdbc.Driver hibernate.dialect=org.hibernate.dialect.MySQL5Dialect hibernate.connection.username=root hibernate.connection.password= hibernate.connection.url=jdbc\:mysql\://localhost\:3306/dbname?create\=true hibernate.hbm2ddl.auto=create
Full stack trace of any exception that occurs: ERROR org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:272) Unsuccessful: create table BRAND (ID_BRAND varchar(255) not null auto_increment, NAME varchar(255) not null, primary key (ID_BRAND)) ERROR org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:273) Incorrect column specifier for column 'ID_BRAND'
Class definition: @Entity @Table(name = "BRAND") public class Brand implements Serializable {
/** * stable serialVersionUID. */ private static final long serialVersionUID = 1L;
@Id @GeneratedValue @Column(name = "ID_BRAND") private String id;
@Column(name = "NAME", nullable = false) private String name;
// GETTERS AND SETTERS
}
_________________ - Fabrizio
|
|