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: mapping type one_zero instead of true_false, yes_no
PostPosted: Wed Mar 25, 2009 6:19 am 
Newbie

Joined: Wed Mar 25, 2009 5:59 am
Posts: 2
I would like to map a CHAR(1) field with possible values of '1'/'0'/null to a java Boolean true/false/null. How to do it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 8:18 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
If you are using Oracle I dont think anything spl would be needed for this. Coz by default true and false goes as 1 and 0 to the DB. So putting the sql-type for the column would be enough. like:

Code:
      <property name="testBool">
         <column name="testBool" length="1" sql-type="char"></column>
      </property>

_________________
Regards,
Litty Preeth


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 11:49 am 
Newbie

Joined: Wed Mar 25, 2009 5:59 am
Posts: 2
thx for the answer. It seems to work now the following way:

@Type(type = "boolean")
public Boolean getField() { ... }


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.