0

Possible Duplicate:
What is the difference between cascade & inverse in hibernate, what is the use of them?

What is Difference between Hibernate Cascade and Inverse properties?

Community
  • 1
  • 1
Kaushik Lele
  • 6,439
  • 13
  • 50
  • 76
  • has been asked @ stackoverflow [link](http://stackoverflow.com/questions/3667387/what-is-the-difference-between-cascade-inverse-in-hibernate-what-is-the-use-o) also check [link2](http://www.mkyong.com/hibernate/different-between-cascade-and-inverse/) – baba.kabira Jan 28 '12 at 10:15
  • @gbagga I have posted my answer to the stackoverflow link. Check and let me know. – Kaushik Lele Jan 28 '12 at 10:40

1 Answers1

0

Cascade

Person has a Address. Without cascade you need to save each of them separately. With cascade the save will automatically. In general it will specify what operations (save, delete etc) should be cascaded to child objects.

Inverse

It identifies the owner of a relationship. It is generally used for optimizing the sql generated i.e. it influences the query generation

Suggested reading: http://www.mkyong.com/hibernate/different-between-cascade-and-inverse/

Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
  • @KaushikLele seems like you are new to SO. You need to accept answers for more people to answer your subsequent questions. I am not asking you to accept mine as the answer but wait and see for more answeres and then pick the most relevant one as the answer – Aravind Yarram Jan 28 '12 at 10:39
  • @gbagga I have posted my answer to the stackoverflow link. Check and let me know – Kaushik Lele Jan 28 '12 at 10:42
  • @KaushikLele so you asked the same question for which you didn't know the answer and then replied it back in the original question? – Aravind Yarram Jan 28 '12 at 10:59
  • @gbagga actually I had read answers for this question at multiple places but did not think that I have understood the concept clearly. So I did the hands on example. Once I could see the actual difference I decided to share this with others. – Kaushik Lele Jan 28 '12 at 11:31