• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question 5 HF page 426

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If an entity bean has been removed from a relationship with bean B in which cases(s) will bean A's accessor method for bean B return a non null value?

1. one to one
2. many to one
3. many to many
4etc

The answer in the book is many to many and it refers to pg 132 from the spec.

My problem with this question is that if you consider that the many to one relationshiop is from bean A to bean B (which would make sense), than answer 2 should also be correct. Or am I missing smth?

If suppose I have Developer-> Boss relation in a many to one relation (so more developers can have the same Boss, and only only one Boss), than if I remove a developer from the relation, still the accessor method from Boss (getDevelopers()) will return a non null value. The remaining developers.
Am I missing something?

Or the question should be more clearly fomrulated that: many to one relation from B to A!

Miki
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Or the question should be more clearly fomrulated that: many to one relation from B to A!



Yes you are right.

But as it is not given that the relationship is one to many from A to B or B to A that means many to many is the only option that is correct.


sawan
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sawan I think you are protecting Kathy & Bert :-)

Miki
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic