-->
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: Recommended Scope for Object ID
PostPosted: Tue Sep 21, 2004 5:51 pm 
Newbie

Joined: Tue Sep 21, 2004 5:42 pm
Posts: 2
I am using Hiberante 2.1.4 for a project and have worked through my entire domain model and mapped it to a relational database using the mapping files. I will have a DAO layer to assist with CRUD of the domain model.

My question is what is the best practice of scoping for ID properties of my domain objects?? They are all single column identity type ID properties defined in the mapping file. It seems a public accessor and a private or protected mutator would be the logical choice. Are there any gotcha's with configuring it this way using Hibernate??


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 21, 2004 6:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Public get / private set method is usually the way I do it - especially in webapps, where you often need to pass around the id in requests parameters. Hibernate itself has no problems with any kind of visiblity.


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.