/** * INTERNAL: * Update the relation table with the entries related to this mapping. * Delete entries removed, insert entries added. * If private also insert/delete/update target objects. */ @Override public void postUpdate(WriteObjectQuery query) throws DatabaseException { if (this.isReadOnly) { return; } // If objects are not instantiated that means they are not changed. if (!isAttributeValueInstantiatedOrChanged(query.getObject())) { return; } if (query.getObjectChangeSet() != null) { // UnitOfWork writeChanges(query.getObjectChangeSet(), query); } else { // OLD COMMIT compareObjectsAndWrite(query); } }
/** * INTERNAL: * Update the relation table with the entries related to this mapping. * Delete entries removed, insert entries added. * If private also insert/delete/update target objects. */ @Override public void postUpdate(WriteObjectQuery query) throws DatabaseException { if (this.isReadOnly) { return; } // If objects are not instantiated that means they are not changed. if (!isAttributeValueInstantiatedOrChanged(query.getObject())) { return; } if (query.getObjectChangeSet() != null) { // UnitOfWork writeChanges(query.getObjectChangeSet(), query); } else { // OLD COMMIT compareObjectsAndWrite(query); } }
/** * INTERNAL: * Update the relation table with the entries related to this mapping. * Delete entries removed, insert entries added. * If private also insert/delete/update target objects. */ public void postUpdate(WriteObjectQuery query) throws DatabaseException { if (isReadOnly()) { return; } // If objects are not instantiated that means they are not changed. if (!isAttributeValueInstantiatedOrChanged(query.getObject())) { return; } Object objectsInMemoryModel = getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); // This accesses the backup in uow otherwise goes to database (may be better of to delete all in non uow case). Object currentObjectsInDB = readPrivateOwnedForObject(query); if (currentObjectsInDB == null) { currentObjectsInDB = getContainerPolicy().containerInstance(1); } compareObjectsAndWrite(currentObjectsInDB, objectsInMemoryModel, query); }