/** * INTERNAL: * Return whether the specified object is instantiated. */ @Override public boolean isAttributeValueFromObjectInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(object); }
/** * INTERNAL: * Return whether the specified object is instantiated, or if it has changes. */ public boolean objectIsInstantiatedOrChanged(Object object) { return objectIsInstantiated(object); }
/** * INTERNAL: * Return whether the specified object is instantiated, or if it has changes. */ public boolean objectIsInstantiatedOrChanged(Object object) { return objectIsInstantiated(object); }
/** * INTERNAL: * Return whether the specified object is instantiated, or if it has changes. */ public boolean objectIsInstantiatedOrChanged(Object object) { return objectIsInstantiated(object); }
/** * INTERNAL: * Return whether the specified object is instantiated. */ @Override public boolean isAttributeValueFromObjectInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(object); }
/** * INTERNAL: * Return whether the specified object is instantiated. */ @Override public boolean isAttributeValueFromObjectInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * Return whether the specified object is instantiated. */ @Override public boolean isAttributeValueFromObjectInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ public boolean isAttributeValueInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ public boolean isAttributeValueInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ public boolean isAttributeValueInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ protected boolean areObjectsToBeProcessedInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ protected boolean areObjectsToBeProcessedInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ protected boolean areObjectsToBeProcessedInstantiated(Object object) { return getIndirectionPolicy().objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSet */ @Override public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects) { // if the object is not instantiated, do not instantiate or cascade Object attributeValue = getAttributeValueFromObject(object); if (attributeValue != null && this.indirectionPolicy.objectIsInstantiated(attributeValue)) { Object realValue = getRealAttributeValueFromObject(object, uow); if (!visitedObjects.containsKey(realValue)){ visitedObjects.put(realValue, realValue); // remove private owned object from UnitOfWork ChangeSet uow.performRemovePrivateOwnedObjectFromChangeSet(realValue, visitedObjects); } } }
/** * INTERNAL: * Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSet */ public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects) { // if the object is not instantiated, do not instantiate or cascade Object attributeValue = getAttributeValueFromObject(object); if (attributeValue != null && this.indirectionPolicy.objectIsInstantiated(attributeValue)) { Object realValue = getRealAttributeValueFromObject(object, uow); if (!visitedObjects.containsKey(realValue)){ visitedObjects.put(realValue, realValue); // remove private owned object from UnitOfWork ChangeSet uow.performRemovePrivateOwnedObjectFromChangeSet(realValue, visitedObjects); } } }
/** * INTERNAL: * Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSet */ @Override public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects) { // if the object is not instantiated, do not instantiate or cascade Object attributeValue = getAttributeValueFromObject(object); if (attributeValue != null && this.indirectionPolicy.objectIsInstantiated(attributeValue)) { Object realValue = getRealAttributeValueFromObject(object, uow); if (!visitedObjects.containsKey(realValue)){ visitedObjects.put(realValue, realValue); // remove private owned object from UnitOfWork ChangeSet uow.performRemovePrivateOwnedObjectFromChangeSet(realValue, visitedObjects); } } }
/** * INTERNAL: * Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet */ @Override public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects) { // if the object is not instantiated, do not instantiate or cascade Object attributeValue = getAttributeValueFromObject(object); if (attributeValue != null && this.indirectionPolicy.objectIsInstantiated(attributeValue)) { Object realObjectCollection = getRealCollectionAttributeValueFromObject(object, uow); ContainerPolicy cp = this.containerPolicy; for (Object cloneIter = cp.iteratorFor(realObjectCollection); cp.hasNext(cloneIter);) { Object nextObject = cp.next(cloneIter, uow); if (nextObject != null && !visitedObjects.containsKey(nextObject)) { visitedObjects.put(nextObject, nextObject); // remove the object from the UnitOfWork ChangeSet uow.performRemovePrivateOwnedObjectFromChangeSet(nextObject, visitedObjects); } } } }
/** * INTERNAL: * Cascade discover and persist new objects during commit. */ public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, boolean getAttributeValueFromObject, Set cascadeErrors) { Object attributeValue = null; if (getAttributeValueFromObject){ attributeValue = getAttributeValueFromObject(object); } else { attributeValue = object; } if (attributeValue != null && this.indirectionPolicy.objectIsInstantiated(attributeValue)) { if (getAttributeValueFromObject){ attributeValue = this.indirectionPolicy.getRealAttributeValueFromObject(object, attributeValue); } // remove private owned object from uow list if (isCandidateForPrivateOwnedRemoval()) { uow.removePrivateOwnedObject(this, attributeValue); } uow.discoverAndPersistUnregisteredNewObjects(attributeValue, isCascadePersist(), newObjects, unregisteredExistingObjects, visitedObjects, cascadeErrors); } }
/** * Delete all the reference objects with a single query. */ protected void deleteAll(DeleteObjectQuery query, AbstractSession session) throws DatabaseException { Object attribute = getAttributeValueFromObject(query.getObject()); if (usesIndirection()) { if (!this.indirectionPolicy.objectIsInstantiated(attribute)) { // An empty Vector indicates to DeleteAllQuery that no objects should be removed from cache ((DeleteAllQuery)this.deleteAllQuery).executeDeleteAll(session.getSessionForClass(this.referenceClass), query.getTranslationRow(), new Vector(0)); return; } } Object referenceObjects = getRealCollectionAttributeValueFromObject(query.getObject(), session); // PERF: Avoid delete if empty. if (session.isUnitOfWork() && this.containerPolicy.isEmpty(referenceObjects)) { return; } ((DeleteAllQuery)this.deleteAllQuery).executeDeleteAll(session.getSessionForClass(getReferenceClass()), query.getTranslationRow(), this.containerPolicy.vectorFor(referenceObjects, session)); }
/** * Delete all the reference objects with a single query. */ protected void deleteAll(DeleteObjectQuery query) throws DatabaseException { Object attribute = getAttributeAccessor().getAttributeValueFromObject(query.getObject()); if(usesIndirection()) { if(attribute == null || !getIndirectionPolicy().objectIsInstantiated(attribute)) { // An empty Vector indicates to DeleteAllQuery that no objects should be removed from cache ((DeleteAllQuery)getDeleteAllQuery()).executeDeleteAll(query.getSession().getSessionForClass(getReferenceClass()), query.getTranslationRow(), new Vector(0)); return; } } Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); ((DeleteAllQuery)getDeleteAllQuery()).executeDeleteAll(query.getSession().getSessionForClass(getReferenceClass()), query.getTranslationRow(), getContainerPolicy().vectorFor(referenceObjects, query.getSession())); }