InterviewSolution
| 1. |
Define Cascade In Nhibernate Mapping File? |
|
Answer» Cascade: enable OPERATIONS to cascade to child entities. cascade=”all | NONE | save-update | delete | all-delete orphan” all: when an object is save/update/delete, check the ASSOCIATIONS and save/update/delete all objects found. none: do not do any cascades, let user handles them by themselves. save-update: when the object is saved/updated, check the associations and save/update any object that require it. delete: when the object is deleted, delete all the objects in the association. all-delete-orphan: when an object is save/update/delete, check the associations and save/update/delete all objects found. in addition to this, when an object is removed from the association and not ASSOCIATED with another object, delete the orphan object also. Cascade: enable operations to cascade to child entities. cascade=”all | none | save-update | delete | all-delete orphan” all: when an object is save/update/delete, check the associations and save/update/delete all objects found. none: do not do any cascades, let user handles them by themselves. save-update: when the object is saved/updated, check the associations and save/update any object that require it. delete: when the object is deleted, delete all the objects in the association. all-delete-orphan: when an object is save/update/delete, check the associations and save/update/delete all objects found. in addition to this, when an object is removed from the association and not associated with another object, delete the orphan object also. |
|