-->
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: Mapping a class to key value pairs
PostPosted: Tue Apr 19, 2005 4:39 am 
Newbie

Joined: Wed Sep 01, 2004 5:56 pm
Posts: 2
Hello,

I apologize if this has already been asked, but I haven't been able to find anything here or in the documentation.

Here is my issue. I've got a SystemPreferences class which just has a bunch of getters and setters for the different preferences which can be set. I'd like to map this onto a two column database table: first column would contain the preference's name, the second would contain the preferences value. I'd like to map it this way for two reasons: 1) It avoids a table with a single row and 2) it makes adding new preferences easier since I don't need to modify the table structure to do it. It woul d seem that mapping this class as a <map> would be the right thing to do, but, from what I can see, you can't do that to an entity and the entity has no <id> which is required. I also can't use a UserType for the same reason. So, is this something I can accomplish using Hibernate or should I just use raw JDBC to handle this one case? If it is worth doing in Hibernate, can someone point me in the correct direction for how I would map this?

Thanks,
--Chris


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.