-->
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 boolen value
PostPosted: Thu Feb 16, 2006 11:52 am 
Newbie

Joined: Mon Oct 10, 2005 1:55 pm
Posts: 12
dear all
i want to map boolean value in my class which gets true / false values.
in my Oracle DB i want Nhibernate to store these values as 1 for true and 0 for false. how do i do that? what should i write in the mapping file???
<property name="IsChecked" column = "IsChecked" type="Boolean" length="1"/>
i guess this gives me T / F???
i nedd to store 1 / 0 in the DB
Thnls alot


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 12:15 pm 
Beginner
Beginner

Joined: Thu Nov 11, 2004 12:18 pm
Posts: 37
Location: Baltimore, MD
You need to specify a hibernate property with the valid true/false values. I treat booleans the same way as you, and I have the property set up as this:

hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'

(I don't think you'll need the yes/no part. )

_________________
-Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 17, 2006 5:56 pm 
Newbie

Joined: Mon Oct 10, 2005 1:55 pm
Posts: 12
OK
So can you write me a complete Property tag which enables me the suiteable substitution????
<hibernate.query.substitutions> where should i put this tag?? in the mapping file? *.hbm.xml file?

Thnks


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.