/** * INTERNAL: * Used to verify whether the specified object is deleted or not. */ public boolean verifyDelete(Object object, AbstractSession session) throws DatabaseException { if (this.isPrivateOwned()) { Object objects = this.getRealCollectionAttributeValueFromObject(object, session); ContainerPolicy containerPolicy = getContainerPolicy(); for (Object iter = containerPolicy.iteratorFor(objects); containerPolicy.hasNext(iter);) { if (!session.verifyDelete(containerPolicy.next(iter, session))) { return false; } } } return true; } }
/** * INTERNAL: * Update the reference objects. */ public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException { if (!this.shouldObjectModifyCascadeToParts(query)) { return; } // if the target objects are not instantiated, they could not have been changed.... if (!this.isAttributeValueInstantiated(query.getObject())) { return; } // manage objects added and removed from the collection Object objectsInMemory = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); Object objectsInDB = this.readPrivateOwnedForObject(query); this.compareObjectsAndWrite(objectsInDB, objectsInMemory, query); }
/** * Delete all the reference objects with a single query. */ protected void deleteAll(WriteObjectQuery query) throws DatabaseException { Object referenceObjects = null; if(usesIndirection()) { Object attribute = getAttributeAccessor().getAttributeValueFromObject(query.getObject()); if(attribute == null || (ClassConstants.IndirectContainer_Class.isAssignableFrom(attribute.getClass()) && !((IndirectContainer)attribute).isInstantiated())) { // An empty Vector indicates to DeleteAllQuery that no objects should be removed from cache referenceObjects = new Vector(0); } } if(referenceObjects == null) { referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); } ((DeleteAllQuery)this.getDeleteAllQuery()).executeDeleteAll(query.getSession().getSessionForClass(this.getReferenceClass()), query.getTranslationRow(), this.getContainerPolicy().vectorFor(referenceObjects, query.getSession())); }
Object objects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) {
Object objects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession());