-->
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: General Questions about classes without identity
PostPosted: Mon Nov 06, 2006 5:01 am 
Newbie

Joined: Mon Nov 06, 2006 4:58 am
Posts: 4
Hi All,

i got following question:

I have a class where i will only store some settings, this settings have to be stored in a database, so i have to make them persistent.
It will be only one datarow in the settingstable with different columns for the settings. I dont need an id.

My question is: How will i map these class? If there is no ID how can i later on load it?

Thanks for any advice
Fabian


Top
 Profile  
 
 Post subject: String as ID
PostPosted: Mon Nov 06, 2006 10:05 am 
Newbie

Joined: Thu Nov 02, 2006 6:59 pm
Posts: 8
Location: London
As long as you have a column that is unique in the database you could use that as your id and use generator type "assigned".

You will then need to set the id yourself before persisting.

In general however, there is no real reason why you cannot have a unique key column in your database.


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.