From: Alexey L. <lou...@us...> - 2004-04-23 20:50:36
|
User: loubyansky Date: 04/04/23 13:50:30 Modified: src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge JDBCCMRFieldBridge.java Log: cascade-delete refactoring: related entity might not have local view -> avoid using EJBLocalObject's, use primary keys instead Revision Changes Path 1.82 +17 -1 jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java Index: JDBCCMRFieldBridge.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- JDBCCMRFieldBridge.java 23 Apr 2004 18:40:37 -0000 1.81 +++ JDBCCMRFieldBridge.java 23 Apr 2004 20:50:29 -0000 1.82 @@ -378,7 +378,23 @@ public boolean removeFromRelations(EntityEnterpriseContext ctx, Object[] oldRelationsRef) { - return cascadeDeleteStrategy.removeFromRelations(ctx, oldRelationsRef); + load(ctx); + + FieldState fieldState = getFieldState(ctx); + List value = fieldState.getValue(); + + boolean removed; + if(!value.isEmpty()) + { + cascadeDeleteStrategy.removedIds(ctx, oldRelationsRef, value); + removed = true; + } + else + { + removed = false; + } + return removed; + //return cascadeDeleteStrategy.removeFromRelations(ctx, oldRelationsRef); } public void cascadeDelete(EntityEnterpriseContext ctx, List oldValues) |