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: Mapping enum
PostPosted: Sat Jul 15, 2006 1:10 am 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
Hi,

one of my class,has an enum as property,can I map it to a column?

thks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 15, 2006 10:24 am 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
Yes, just set the type to your enum

<property name="MyMutator" column="MyIntColumn" type="MyNamespace.MyEnum, MyAssembly" />

Remember to make the DB type match your underlying enum type (int)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 4:07 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
you might find this interesting if you want to store the name value of the enum instead of the integer value:

http://forum.hibernate.org/viewtopic.php?t=959047


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.