Clarification « Update « JPA Q&A





1. Clarification for Java Persistence with Hibernate    coderanch.com

In chapter 6.4 of JPwH (Mapping a parent/children relationship), should the setter Bid.setItem() be something like this: public class Bid { ... public void setItem(Item item) { [B]this.item.getBids().remove(this);[/B] this.item=item; [B]item.getBids().add(this);[/B] } } instead of just public void setItem(Item item) { this.item=item; } I mean my setter should manually remove any existing associations before creating new ones. The examples given by the ...

2. Need clarification for Update in Hibernate    coderanch.com

Currently I am doing that only. Instead of the name, I have another entity that needs to be loaded from the data base. So it is like 2 select statements to load the child and Parent (both of type person). and another statement to update the child with the new parent set in it. There are 3 sql statement executed in ...

3. Clarification Needed For saveOrUpdateCopy    forum.hibernate.org

I'm using Hibernate 2.1.6, and trying to maintain an audit trail for an object. The object is called Person, and it has a many-to-one association to Address (cascade all, unidirectional). The webapp lifecycle for this process follows: 1) Retrieve the object from the database, convert to a form object. 2) Send to the user; user submit changes. 3) Load the original ...

4. Tranparent Persistence Clarification    forum.hibernate.org

I am developing a system with the Spring Framework and Hibernate and I am using the DAO Pattern to abstract my data access code. Something that seems odd to me is the transparent persistance mechanism of hibernate. It seems to be making my DAO obsolete on edits. Here is what I mean: Code: ClientDAO dao = new DefaultClientDAO() ; Client client ...