-->
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: Multibyte strings, Hibernate, MySQL and MSSQL
PostPosted: Wed Aug 03, 2011 9:15 am 
Newbie

Joined: Wed Aug 03, 2011 8:55 am
Posts: 1
Hi,
We have an application that needs to support multibyte strings (japanese characters, chinese characters, etc). We use Hibernate with JPA annotations to create the tables in our database, so no mapping files at all. We support MSSQL and MySQL. I have two questions:

1.) How do I tell Hibernate via annotations that I need a certain field in my class to be created in the database as a multibyte string type (for example NVARCHAR in MSSQL) and not a regular (VARCHAR) string type?

2.) When using the above annotation, I need it to dynamically generate the appropriate multibyte string type for the underlying database (MySQL or MSSQL). If this cannot happen automatically, can I have a test in the annotation to create NVARCHAR if db is MSSQL or the relevant MySQL type if the db is MySQL?

Kind regards,
bhoon


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.