public void removeTarget(Object source, Object target, boolean setReverse) { // TODO, Andrus, 2/9/2006 - CayenneDataObject differences: // * has a callback to ObjectStore to handle flattened // * changes object state to modified // Now do the rest of the normal handling (regardless of whether it was // flattened or not) Collection<Object> collection = (Collection<Object>) readProperty(source); collection.remove(target); if (target != null && setReverse) { setReverse(source, target, null); } }
public void addTarget(Object source, Object target, boolean setReverse) { if (target == null) { throw new NullPointerException("Attempt to add null object."); } // TODO, Andrus, 2/9/2006 - CayenneDataObject differences: // * invokes "willConnect" // * has a callback to ObjectStore to handle flattened // * has a callback to ObjectStore to retain snapshot // * changes object state to modified // Now do the rest of the normal handling (regardless of whether it was // flattened or not) Collection<Object> collection = (Collection<Object>) readProperty(source); collection.add(target); if (setReverse) { setReverse(source, null, target); } }