• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Cascade-delete & multiplicity

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In HFEJB 420, in the BulletPoint about Cascade-delete,it says,
Cascade-delete works only if the bean has a multiplicity of One.
In Page 395, DirectorBean has Multiplicity as One and MovieBean has Multiplicity as Many. Here Cascade-delete comes in MovieBean? Am I missing something here?
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can optionally specify a role as Cascade-delete in the DD if and only if the OTHER PARTY in the relationship has a multiplicity of One.

This means that Many-to-Many relationships cannot have Cascade-delete in either of the 2 ends (roles).

I hope this does not confuse you but it helps me : I always think of the role as having Cascade-delete as the "weaker" role. The Movie role is "weaker", that's why it is allowed to have the optional Cascade-delete attribute. "Weaker" in the sense that when a Director is deleted, all the movie bean related to that director will be deleted. The "power" is at the Director's end (role).
 
saran ram
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you timothy, I got it now, so its the other party in the relationship should have multiplicity one.
 
Does this tiny ad smell okay to you?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic