-->
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.  [ 4 posts ] 
Author Message
 Post subject: Persistable Object Without ID?
PostPosted: Thu May 12, 2005 2:10 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
Is it possible to have a persistable object without an ID property? I have millions of objects that are saved often, and a primary key is not necessary. Each has a timestamp, but there may be two objects with the same timestamp.

I'm trying to save as much database space as possible.

Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 12:29 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
Anyone? If this is not possible, just let me know.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 4:50 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
From Hibernate In Action:

Quote:
If there are no unique columns or unique combinations of columns, and hence no candidate keys, then the table is by definition not a relation as defined by the relational model (it permits duplicate rows), and you should rethink your data model


If your table really doesn't permit duplicate rows, then you can always make every column part of the PK.

Personally, I wouldn't think saving a little disk space is worth the trouble, and would just add a PK column.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 5:41 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
Understood. I appreciate the response.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.