-->
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: Configure EnumUserType using annotations
PostPosted: Mon Apr 07, 2008 2:50 am 
Newbie

Joined: Fri Jul 07, 2006 6:20 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b] 3.2.5

[b]Mapping documents:[/b] annotations based

Can anybody tell me how to configure EnumUserType (http://www.hibernate.org/272.html) using annotations ?


Top
 Profile  
 
 Post subject: Re: Configure EnumUserType using annotations
PostPosted: Mon Apr 07, 2008 6:41 am 
Newbie

Joined: Thu May 05, 2005 5:54 am
Posts: 17
avinash.thm wrote:
Can anybody tell me how to configure EnumUserType (http://www.hibernate.org/272.html) using annotations ?


you should use the Enumerated annotation

@Enumerated()
private MyEnumerateType type;

this persists the ordinal and so you should preserve the order of the values in the enum definition if you don't want to break all.

you cal also persist the string value by specifying
@Enumerated(EnumType.STRING)

but i never used it

ciao


Top
 Profile  
 
 Post subject: need help to configure EnumUserType class
PostPosted: Mon Apr 07, 2008 11:31 am 
Newbie

Joined: Fri Jul 07, 2006 6:20 am
Posts: 4
I want to configure EnumUserType class using annotations.

The configuration of this class is shown in the begining with typedef tag.
( u can see this heading - Example Mapping - using <typedef> )

I want the same configuration to be done using annotations.
Can anybody guide me?


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.