-->
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: Creating Enumeration Tables for Foreign Key Locking
PostPosted: Thu Aug 30, 2007 1:34 pm 
Newbie

Joined: Thu Dec 30, 2004 7:44 am
Posts: 15
Hibernate version: 3.2
Name and version of the database you are using: H2 1.0.57

I have a number of objects in my model that use enumerations (both JDK5.0 and some JDK 1.4 Enumeration Patterns (ala Bloch and Simmons). What I would like to do is have hibernate create a table in the schema that contains the enumeration and has the values of the enumeration as rows with their ordinal values as primary key. Then I would have the enumeration stored in my tables as a foreign key to the table containing the enumeration values. This would allow me to make sure my database can not contain invalid enumeration values because of the foreign key constraints.

Does anyone have any ideas how to do this?


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.