-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: [Hib.3.2.0.cr2, MYSQL 5.0] problem in primary keys creation
PostPosted: Thu Jun 22, 2006 5:01 am 
Newbie

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.