This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Use of cascade option instead of bidirectional association Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Use of cascade option instead of bidirectional association" Watch "Use of cascade option instead of bidirectional association" New topic
Author

Use of cascade option instead of bidirectional association

vijay jacob
Ranch Hand

Joined: Jul 02, 2013
Posts: 57


I understand we have lot of cascade option like save , update, delete. all .

My question is when we set a bidirectional association. If we save parent , the child arlready get saved right??

So we do not really need a cascasde option right?? I believe the delete also work the same way as save (bidirectional).


Please help me with this doubt.
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1025
    
    5

Vijay

My question is when we set a bidirectional association. If we save parent , the child arlready get saved right??


Not by default. If no cascade type is specified, no cascading will occur.



If this scenario, if A is saved, B is not and vice versa.
vijay jacob
Ranch Hand

Joined: Jul 02, 2013
Posts: 57


So cascade By works only in bidirectional association.

So if no cascasde is given , does that it mean the assocaiton is only for fetching..
 
wood burning stoves
 
subject: Use of cascade option instead of bidirectional association