-->
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.  [ 1 post ] 
Author Message
 Post subject: JpaTemplate - Flush functionality
PostPosted: Mon Aug 04, 2014 7:42 pm 
Newbie

Joined: Mon Aug 04, 2014 7:33 pm
Posts: 1
Hi,
I have two entities, one is parent and the other one is child.
Parent to Child is OneToMany mapping. And Child to Parent is ManyToOne mapping.
As we use JPA, we have mappedBy attribute on OneToMany mapping correctly.
So when I create a child entity, add it in the set at the parent and save the child entity, I am seeing only one insert into the child table.

But as part of the transaction when we use JpaTemplate.flush() that is where I see an update into parent table. As the number of child objects in the set are different.
Isn't it because of mappedBy attribute we are mentioning that do not update the parent each time an insert into the child table?

Please let me know.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.