Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

CMR fields One to Many relationships

 
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we have a One to Many relationship, say a Director with it's Movies, we can do the following:

movie1.setDirector(movie2.getDirector());

In this case, the container will MOVE movie1's reference from the current collection and place it in the collection where movie2 is found. Great.

But, i don't quite understand what is ment by saying that in this case the director reference is COPIED from one movie to another.

This example is clearer in HFEJB page 422.

Regards.
 
Marcelo Ortega
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone clarify this?
 
Ranch Hand
Posts: 2107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>>In this case, the container will MOVE movie1's reference from the current collection and place it in the collection where movie2 is found. Great.

But, i don't quite understand what is ment by saying that in this case the director reference is COPIED from one movie to another.
<<<

It is 'copied' only, as other movie can also belong to that director.

In the first case, the movie is 'moved' as no other director would have that movie anymore-only 1.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesus Angeles,
I agree with you. COPYing reference means Movie2 will have the same director reference as well as Movie1.

Thanks,
Ugender
 
BWA HA HA HA HA HA HA! Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!