-->
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: hbm2ddl tool: support of UTF-8 in generated DDL script
PostPosted: Tue Sep 15, 2009 11:55 am 
Newbie

Joined: Tue Sep 15, 2009 11:45 am
Posts: 1
The context:
I currently use a mapping file for a Java class that has a Japanese (with kanjis) name, as well as some of its attributes.
The mapping file uses the same Japanese Strings, escaped with backquotes. Mapped tables and column names also use japanese characters (kanjis or hiraganas).

I use <hibernatetool> in a Ant file, with the following setting of hbm2ddl:

Code:
<hbm2ddl export="true" format="true" outputfilename="DBSchema.ddl"/>


I need both to create the schema in the database (a MySQL) and in a text file.

The issue:
I have no issue creating the DB schema that contains table and column names with japanese characters, provided that I use the option hibernate.connection.characterEncoding=UTF-8.

However, the generated DDL file doesn't look good, since I obtain something like that:

Code:
create table `?` (
        `ID_???` varchar(255) not null,
        `????` varchar(255),
        primary key (`ID_???`)
    );


Is there any way to keep the right encoding for the japanese characters in the generated DDL file? I found nothing about this concern in the documentation.

Thanks in advance,
Arnaud


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.