ColdFusion 9.0 Resources |
Cascading optionsCascading lets you specify the operations to be cascaded
from the parent object to the associated object. The supported operations
are INSERT, UPDATE, and DELETE. The cascadeType attribute
lets you set any of the following values.
The one-to-one, one-to-many, many-to-one, and many-to-many relationships are
all supported by cascading. You can use code like the following
to specify the cascading options:
ManyToMany(cascadeType="ALL or PERSIST or REMOVE") If you do not specify the cascadeType option, only the source entity is persisted or updated. When you specify cascadeType='ALL or REMOVE'to remove the parent object and the associated child objects, load the parent object using load***() method and pass it through session.remove(parentObj). If you do not use this method of loading, only the parent object gets deleted from SQLite database and the child objects remain. Note: If you have enabled lazy loading by specifying fetchType='LAZY' at
the entity level, when you load a parent object using load***() method,
the child objects are not loaded. When you specify cascadeType='ALL or REMOVE' and
try to delete the parent object by passing it through session.remove(parentObj),
it does not delete the child objects. To overcome this limitation,
use the load***() method with ignorelazyloading='true'.
|