-->
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: custom type mapping and annotations/reverse engineering
PostPosted: Thu Mar 02, 2006 4:39 am 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
Hibernate version:
3.1.2
Mapping documents:
Annotations API 3.0.5ß

Hi all,

I wrote a user type "JaNeinType" analog to the "YesNoType", which comes out of the box with Hibernate. I'd like to work with Booleans inside my Java objects and the mapping to "J" resp. "N" should be done when saving. This shouldn't be a problem as it works for "yes_no" and "true_false" too.

When I try to put "ja_nein" in my hibernate.reveng.xml it will be written 1:1 as ja_nein in my generated classes. If I use yes_no it will be mapped to Boolean correctly.

In the hibernate.reveng.xml I could use a mapping to java.lang.Boolean and add the type mapping to my velocity template which works fine.

Code:
@Type(type="ja_nein")


But when starting the application I get Exceptions that the mapping is not correct. Where can I tell Hibernate to use my JaNeinType with Annotations and to map it to a Boolean in my Java objects?

Rgds,
Axel

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 5:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
goto the user forum please.

(hint: ja_nein does not look like a classname to me ,)

_________________
Max
Don't forget to rate


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.