• 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

Multiplicity of the relationship

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
on pag. 422 of HF

"If the multiplicity of the relationship field is ONE, it's a MOVE
If the multiplicity of the relationship field is MANY, it's a COPY
"

I've seen the example but I still don't understand :roll:

May you gimme a little hint, or a simple trick to understand it better?

Thanks
[ July 08, 2005: Message edited by: marcus don ]
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Follow the sample of relation between movies and directors as specified right there.
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First assumes, For every entity objects selected as result of findByXXX has indiviual reference and return as whole collection in single reference(Collection reference).

So, many to one means, the entity objects in collection(one side as cmr field) can be possible in the one collection of the same relation ship type.

So that if we want one entity object from one collection to another collection means, effectively as move the entity object from one collection to another collection.

Likewise many to many relation ship means, one entity objects can be possible in more than one collection, so that the same entity object reference can be possible in more than one collection, so that if we want one entity object from one collection to another collection means entity objects reference are copied.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic