-->
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: Support for @Enumerated tag during reverse engineering
PostPosted: Fri Dec 04, 2009 4:58 pm 
Newbie

Joined: Fri Dec 04, 2009 4:51 pm
Posts: 1
I'm using the hibernate tools, along with the maven hibernate tools plugin to generate JPA entities directly from my database schema.

I have a few columns that are enumerated values (e.g. a status column) define as simple varchars and the status' are defined in java enumerations. I want to have the generated classes use the enums instead of a string to force stronger typing. I don't want to use an ENUM type for the column in the database; this makes changes to the enumerated types more of a pain to manage since it requires a database migration.

If I add a column override and set the hibernate type to my enum class it generates the correct code however this does not work with the database. I need the JPA annotation @Enumerated(EnumType.String) however I can find no way in the reverse engineering file to force this to be created.

Anyone have any ideas?


Top
 Profile  
 
 Post subject: Re: Support for @Enumerated tag during reverse engineering
PostPosted: Sun Dec 13, 2009 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
simply not implemented yet. care to create a patch ?

look at the .ftl templates and what code it calls for annotations.

_________________
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.