-->
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: annotations 3.1 b4 and "Y"/"N" d/b colum
PostPosted: Tue Aug 09, 2005 11:54 pm 
Newbie

Joined: Tue Aug 09, 2005 11:22 pm
Posts: 2
Hi,

I've been trying to retro-fit an existing app using hibernate+annotations as a learning exercise (though I feel the d/b structure is going to bite me...). Anyhow, I'm having problems with boolean values, which are stored in the database in single character columns ("Y"/"N").

When I run the code, ResultSet's getBoolean is called and I end up with the (expected) exception:
java.lang.NumberFormatException: For input string: "N"

You can do this in the XML mapping with type="yes_no" for the property, but I can't seem to find an annotations equivalent. Is there a way to do this using annotations?

thanks,
t.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 5:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Sure @Type

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 7:51 pm 
Newbie

Joined: Tue Aug 09, 2005 11:22 pm
Posts: 2
Thanks, @Type(type="yes_no") works.


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.