Annotation Interface OnDelete
The annotation can only be used on reference association
based on foreign key.
When the parent object of some child objects is deleted,
- If the attribute of @OnDelete is NONE, throw exception
- If the attribute of @OnDelete is SET_NULL, they parent properties of child objects will be set null
- If the attribute of @OnDelete is DELETE, the child objects will be deleted too.
Note:
Parent object can discard some child objects. When using the save command, if the parent object in the database has some child objects, but the user overrides it and the new parent object argument specified by the user does not contain some existing child objects, these child objects will be discarded.
In this case, although the parent object is not deleted, the same method is used to clear the parent reference of the discarded child objects or delete the discarded child objects.
-
必需元素概要
所需元素
-
元素详细资料
-
value
DeleteAction value
-