I'm using H2Database for unit testing and it Hibernate to create-drop
the schema each time a connection is created.
I know that H2 supports UTF8 but in my production DB I'm using MySql
with a single column configured to utf8.

I have a class that looks somewhat as follows:

@Entity
public class Foo {
   @Id
   @GeneratedValue
   private Long id;

   @Column(nullable = false, columnDefinition = "varchar(255)
character set utf8")
   private String name;
}

And I'm getting the following errors

17:27:58,452    ERROR    org.hibernate.tool.hbm2ddl.SchemaExport --
Unsuccessful: create table Foo (id bigint not null auto_increment,
name varchar(255) character set utf8, primary key (id))
17:27:58,454    ERROR    org.hibernate.tool.hbm2ddl.SchemaExport --
Syntax error in SQL statement "CREATE TABLE FOO (ID BIGINT NOT NULL
AUTO_INCREMENT, NAME VARCHAR(255) CHARACTER[*] SET UTF8 NOT NULL,
PRIMARY KEY (ID)) "; expected ")"; SQL statement: ... [42001-148]

Data source URL is as follows:
jdbc:h2:mem:testdb;MODE=MySQL;DB_CLOSE_DELAY=-1;TRACE_LEVEL_SYSTEM_OUT=2;IGNORE_UNKNOWN_SETTINGS=TRUE

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to