Hibernate Books

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: A point of confusion on the domain model (Chapter 3)
PostPosted: Fri Aug 14, 2009 3:57 pm 
Newbie

Joined: Wed Aug 12, 2009 10:45 am
Posts: 16
When the book is talking about managing bidirectional dependencies, like Category self referring dependency(when a Category has a parent Category and a list of child categories), it is recommended that to enforce the data integrity, an unmodifiable collection be returned from the getter, but when it comes to dirty checking by hibernate, it says you have to return the SAME collection passed to the getter or unnecessary updates will be made!

I would like some explanation on this point. Many thanks.

Kamal


Top
 Profile  
 
 Post subject: Re: A point of confusion on the domain model (Chapter 3)
PostPosted: Sat Aug 15, 2009 10:15 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Well, then annotate/map the collection field, not the getter.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.