Monday, December 9, 2013

ADF Association composition behaviors


If we select Implement cascade delete operation,
  • First it will generate delete query on the child entities and invoke the delete query.
  • Next it will generate delete query on the parent entity and invoke the delete query.
  • Then it will issue commit.

If we select optimize for Database cascade delete operation and in the foreign key ON DELETE CASCADE
  •  First it will generate delete query on the parent entity and invoke the delete query
  •  While deleting the parent record, it will delete child the child records at the DB level as we have implemented ON DELETE CASCADE.
  • It will issue commit.
  • It will clear the child entities from the cache for that parent record.

If we select optimize for Database cascade delete operation and in the foreign key we don’t set ON DELETE CASCADE
  • First It will generate delete query on the parent entity and invoke the delete query.
  • While deleting the parent record, it will throw Database constraint exception as we have not implemented ON DELETE CASCADE and SQL Exception will be thrown.

If we select Cascade update key attributes,
·         When updating the parent key attributes, it will update the child record’s foreign key attributes.

If we don’t select Cascade update key attributes, it will throw exceptions while trying to update the parent records primary key.

If we select update Top level history columns, it will update the parent records history columns when we are trying to add/update child records.

If we select Lock level to Lock Container, While updating the child record it will lock the immediate parent record.

If we select Lock level to Lock Container, While updating the child record it will lock the all the parent records in the hierarchy.

No comments:

Post a Comment