-->
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.  [ 3 posts ] 
Author Message
 Post subject: hbm2ddl default to unicode types
PostPosted: Sun Mar 25, 2007 7:01 pm 
Newbie

Joined: Sun Mar 25, 2007 6:42 pm
Posts: 2
Location: Auckland
Hibernate version: 3.2

Name and version of the database you are using: SQL Server 2000, Oracle 10g

Hi all,

I'm trying to get the hbm2ddl tool to generate unicode types such as nvarchar by default not varchar.

Is this possible?

Or is the only option to go through all my annotated beans and set the sql-type?

Cheers,
Tim


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 5:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you can tweak a subclass of your dialect to use a different type that the defaults.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 10:34 pm 
Newbie

Joined: Sun Mar 25, 2007 6:42 pm
Posts: 2
Location: Auckland
Thanks Max.

For anyone else trying to do this I just needed these two lines..
Code:
   registerColumnType( Types.CHAR, "nchar(1)" );
   registerColumnType( Types.VARCHAR, "nvarchar($l)" );
[/code]


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

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.