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
|