Chapter 8 Creating J2EE Applications for BEA WebLogic
If an entity is deleted and the cascade delete element is specified for a related entity bean, then the removal is cascaded and any related entity bean objects are also removed. Also, after removing the entity objects from which
To specify cascade delete, use the cascade-delete element in the ejb-jar.xml deployment descriptor elements. This is the default method. Make no changes to your database settings and WebLogic Server will cache the entity objects for removal when the cascade delete is triggered.
Specify cascade delete using the cascade-delete element in the ejb-jar.xml file as follows:
<ejb-relation> <ejb-relation-name>Customer-Account</ejb-relation-name> <ejb-relationship-role> <ejb-relationship-role-name>Account-Has-Customer </ejb-relationship-role-name> <multiplicity>one</multiplicity> <cascade-delete/> </ejb-relationship-role> </ejb-relation>
Note: This cascade delete can only be specified for an ejb-relationship-role element contained in an ejb-relation element if the other ejb-relationship-role element in the same ejb-relation element specifies a multiplicity of one.
Copyright (C) 2005. Sybase Inc. All rights reserved. |
![]() |