/** Update single parent to child relationship. * @param parent The parent of the child. * @param oldChild The previous value of the child. If this is non null and differs from <code>child</code>, then a remove event is generated. * @param child The current child. If this is non null and differs from <code>oldChild</code>, then an add event is generated. * @param relationship The name of the relationship */ public synchronized void update(Object parent, Object oldChild, final Object child, String relationship) { if (oldChild!=null && !oldChild.equals(child)) remove(parent,oldChild,relationship); if (child!=null && !child.equals(oldChild)) add(parent,child,relationship); }
/** Update single parent to child relationship. * @param parent The parent of the child. * @param oldChild The previous value of the child. If this is non null and differs from <code>child</code>, then a remove event is generated. * @param child The current child. If this is non null and differs from <code>oldChild</code>, then an add event is generated. * @param relationship The name of the relationship * @param addRemoveBean If true add/remove is called for the new/old children as well as the relationships */ public synchronized void update(Object parent, Object oldChild, final Object child, String relationship,boolean addRemove) { if (oldChild!=null && !oldChild.equals(child)) { remove(parent,oldChild,relationship); if (addRemove) removeBean(oldChild); } if (child!=null && !child.equals(oldChild)) { if (addRemove) addBean(child); add(parent,child,relationship); } }
add(parent,newChildren[i],relationship);