• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate - SaveorUpdate

 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am analyzing some third party hibernate code. I can't execute it to test. I Need some inputs for help.

I have a parent-child mapping defined in the hbm.xml files.

Parent.setChild(c);

Parent.setAddess();
.
.
..
And few other setter for parent.

But in the end, the data is commited using the statement

" getSession().saveOrUpdate(Parent.getChild()); "

is this code fine ?.. will it commit the child details to db or the parent details also ?

Thanks,
Neeraj.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!