-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping Boolean to SQLServer BIT
PostPosted: Fri Apr 10, 2009 8:59 am 
Newbie

Joined: Fri Apr 10, 2009 8:57 am
Posts: 1
Can anyone shed some light as to how to map a Boolean to a BIT column type?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 13, 2009 6:46 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
There is a property you can set on the configuration

http://forum.hibernate.org/viewtopic.php?p=2376058
http://forum.hibernate.org/viewtopic.php?p=2376058

This property only works when you are using hql.

I am not sure about mappings but I know if you annotate the properties and not the getters or setters it will access the property directly skipping the getters or setters, which would allow you to do something like this.

public boolean isTest(){
if(this.test==1)
return true;
else
return false;
}

public void isTest(boolean test){
if(test)
this.test=1;
else
this.test=0;
}

There are other ways also, which I can remember but maybe someone else can give their input.

_________________
Please rate my replies as I need points for all of my questions also.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.