-->
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.  [ 1 post ] 
Author Message
 Post subject: Adding an Enum as an @entity
PostPosted: Wed Dec 28, 2011 7:03 am 
Newbie

Joined: Sat Jan 01, 2011 4:31 am
Posts: 6
Hi All!

I have an Enum that has String values. I want to map it in my mysql DB in a table. It has static strings.
I am using this example to accomplish this:

http://community.jboss.org/wiki/UserTypeForPersistingAnEnumWithAVARCHARColumn

What I am doing is I am using annotations like @Entity. The main goal is to have entities marked with @Entity and all the JPA annotations for table column mappings and when i create the Session Factory for Hibernate, it generates the tables in my DB so my enum class also is generated with the table and has the String values pre defined in the Db like a lookup table.

Thanks in advance.

Syed...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.