Thread:
 Most Tables can only use Identity Property for equ... 
 Goonie   14 Feb 2004, 14:21 
 Re: Most Tables can only use Identity Property ... 
 tibi   09 Feb 2005, 07:38 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: Goonie (14 Feb 2004, 14:21) Replies: 1, Views: 39429
Subject: Most Tables can only use Identity Property for equals/h...
There are so many persistant classes with the identity property (primary
key) being the only feasible identifier. To be exact, only classes whose
tables have an additional unique constraint allow for safely using other
properties than the identity for equals/hashCode.

Unless I do misunderstand the matter, I have only two choices for about
99% of my persistant classes:

- using self assigned identities (primary keys) and assign them before
using the entity in a collection.

- using database assigned identites and forcing early assignment by
session.save().

Any other choices?

Regards,

Andreas
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]