-->
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: YesNoType & Annotations
PostPosted: Mon Oct 02, 2006 7:32 pm 
Newbie

Joined: Mon Oct 02, 2006 7:25 pm
Posts: 1
I am using Hibernate Annotations (with JBoss 4.0.4.GA), and would like to model a boolean property mapped to a 'Y'/'N' database column. I see the YesNoType or even UserType, but it is not clear to me how to configure this, since all of the mapping is in annotations rather than mapping xml.

Hints would be appreciated.

Hibernate version:3.2.0.CR1
Name and version of the database you are using: Oracle 9


Top
 Profile  
 
 Post subject: Re: YesNoType & Annotations
PostPosted: Wed Jan 02, 2013 1:20 pm 
Newbie

Joined: Wed Jan 02, 2013 1:16 pm
Posts: 1
If you're using JPA, I'd recommend spelling out the fully qualified annotation name for the Hibernate Type annotation, as follows:

@Column(name = "my_flag") // regular JPA annotation
@org.hibernate.annotations.Type(type = "yes_no")
private Boolean myFlag;


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