• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Cascade attribute

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to know when we use cascade attribute. I saw setting cascade=true within set property attribute while doing many-one, one-many association hibernate examples. any ideas, suggestions, sample code, resources, links highly appreciated.thanks in advance
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cascade is used when an item in table A relies on an item in Table B (ie has a foreign key reference) and the data in table A has no meaning if the item in Table B is deleted.

eg A Person has an Address, the Address contains the ID of the Person. If a Person is deleted then the delete operation should cascade so that it deletes the Address to.
Operations should not always cascade but you should consider the impact of deletes (and other operations) on foreign key constraints.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you haven't seen the messages regarding your display name in your private messages, you should do so immediately.
Please consider this your final warning.
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>>If you haven't seen the messages regarding your display name in your private messages, you should do so immediately.

where can i find private messages. Please let me know
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic