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.  [ 3 posts ] 
Author Message
 Post subject: Identifier Attributes
PostPosted: Mon Jun 20, 2005 6:22 am 
Newbie

Joined: Mon Jun 20, 2005 6:15 am
Posts: 5
Hi,

I've just downloaded and read through a few chapters of the documentation and get confused with the idea of 'identifier attribute'

Isn't the identifier attribute similiar the primary-key which we define it ourselves instead of generated by hibernate?

as an example the class User which has following fields:
-username (unique)
-firstname
-lastname

Is the username the identifier attribute? Or shall we create an extra column 'id' just to satisfy the hibernate functionality?

tx.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 7:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no you can use your natural id as an identifier.

we just recommend surrogate identifiers since they are better in most scenarioes (no matter if you are using hibernate or not)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 11:12 am 
Newbie

Joined: Mon Jun 20, 2005 6:15 am
Posts: 5
thansk for the reply.

Quote:
no you can use your natural id as an identifier.

do you mean, the naturalId is in this case 'username'?


Documentation Feedback
I've been reading the wellwritten reference documentation. But however it takes me more times to get the scattered examples code up and running. Besides this each chapter do not always comes with examples.

And how to start learning through the provided test cases? Is there any brief documentation for each test cases?

tx.


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