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: How do i use boolean type, if database column is number?
PostPosted: Wed Nov 08, 2006 9:40 am 
Newbie

Joined: Thu Jan 19, 2006 7:24 am
Posts: 17
I want to use boolean for my programming, but my database not support
one, so I used database number type to represented to boolean.

How do i use boolean type, if database column is number?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 9:46 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Write a usertype to do the conversion.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 12:24 pm 
Newbie

Joined: Wed Sep 06, 2006 8:33 am
Posts: 19
In your configuration use:

Code:
(...)
Configuration cfg = new Configuration();
cfg.SetProperty(NHibernate.Cfg.Environment.QuerySubstitutions,"true=1,false=0");
(...)


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.