-->
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: Portable boolean handling (SQLServer and Oracle)
PostPosted: Thu Sep 01, 2005 3:55 am 
Newbie

Joined: Sat Apr 02, 2005 2:17 am
Posts: 11
We have a database which needs to work on both Oracle and SQLServer, and we're using Hibernate to talk to it (obviously). Currently we're using Hibernate 3.0.5 and Annotations 3.0beta2, but those could change if necessary.

We have a few fields which are BIT fields in SQLServer, which obviously Oracle doesn't support. The normal way round this for Oracle is to use a CHAR(1) field and T/F, 0/1, Y/N or something similar.

Is there any way to express this in annotations, such that I can declare a property with a boolean type, and the appropriate type converter will be used? If not, I guess we'll convert all of the fields to TINYINTs or something similar, but it would be nice not to have to.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 7:17 am 
Newbie

Joined: Sat Apr 02, 2005 2:17 am
Posts: 11
Not to worry - we've decided to move to using CHAR(1) everywhere, and annotate the properties appropriately. (I assume the Hibernate-specific Type/TypeDef annotations are the way to go?)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 7:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes use a usertype

_________________
Emmanuel


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.