aspose file tools*
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: 1030
    
    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..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of cascade option instead of bidirectional association