/** * Convenience method. */ private Object getRealCollectionAttributeValueFromObject(Object object, AbstractSession session) { return this.getMapping().getRealCollectionAttributeValueFromObject(object, session); }
/** * Convenience method. */ private Object getRealCollectionAttributeValueFromObject(Object object, AbstractSession session) { return this.getMapping().getRealCollectionAttributeValueFromObject(object, session); }
/** * Convenience method. */ private Object getRealCollectionAttributeValueFromObject(Object object, AbstractSession session) { return this.getMapping().getRealCollectionAttributeValueFromObject(object, session); }
/** * Delete all the reference objects. */ protected void deleteAll(DeleteObjectQuery query) throws DatabaseException { Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); deleteAll(query, referenceObjects); }
/** * Delete all the reference objects. */ protected void deleteAll(DeleteObjectQuery query) throws DatabaseException { Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); deleteAll(query, referenceObjects); }
/** * Delete all the reference objects. */ protected void deleteAll(DeleteObjectQuery query) throws DatabaseException { Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); deleteAll(query, referenceObjects); }
/** * INTERNAL: * If any of the references objects has changed, write out * all the keys. */ @Override public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException { if (!this.isAttributeValueInstantiatedOrChanged(writeQuery.getObject())) { return; } AbstractSession session = writeQuery.getSession(); if (session.isUnitOfWork()) { // PRS2074 fix for "traditional" Indirection Object collection1 = this.getRealCollectionAttributeValueFromObject(writeQuery.getObject(), session); Object collection2 = this.getRealCollectionAttributeValueFromObject(writeQuery.getBackupClone(), session); if (this.compareObjectsWithoutPrivateOwned(collection1, collection2, session)) { return;// nothing has changed - don't put anything in the row } } this.writeFromObjectIntoRow(writeQuery.getObject(), row, session, WriteType.UPDATE); }
/** * INTERNAL: * If any of the references objects has changed, write out * all the keys. */ public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException { if (!this.isAttributeValueInstantiatedOrChanged(writeQuery.getObject())) { return; } AbstractSession session = writeQuery.getSession(); if (session.isUnitOfWork()) { // PRS2074 fix for "traditional" Indirection Object collection1 = this.getRealCollectionAttributeValueFromObject(writeQuery.getObject(), session); Object collection2 = this.getRealCollectionAttributeValueFromObject(writeQuery.getBackupClone(), session); if (this.compareObjectsWithoutPrivateOwned(collection1, collection2, session)) { return;// nothing has changed - don't put anything in the row } } this.writeFromObjectIntoRow(writeQuery.getObject(), row, session); }
/** * INTERNAL: * If any of the references objects has changed, write out * all the keys. */ @Override public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException { if (!this.isAttributeValueInstantiatedOrChanged(writeQuery.getObject())) { return; } AbstractSession session = writeQuery.getSession(); if (session.isUnitOfWork()) { // PRS2074 fix for "traditional" Indirection Object collection1 = this.getRealCollectionAttributeValueFromObject(writeQuery.getObject(), session); Object collection2 = this.getRealCollectionAttributeValueFromObject(writeQuery.getBackupClone(), session); if (this.compareObjectsWithoutPrivateOwned(collection1, collection2, session)) { return;// nothing has changed - don't put anything in the row } } this.writeFromObjectIntoRow(writeQuery.getObject(), row, session, WriteType.UPDATE); }
/** * 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: * Used to verify whether the specified object is deleted or not. */ @Override 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: * Used to verify whether the specified object is deleted or not. */ @Override 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 (isForeignKeyRelationship()) { return; } if (!this.shouldObjectModifyCascadeToParts(query)) { return; } // if the target objects are not instantiated, they could not have been changed.... if (!this.isAttributeValueInstantiatedOrChanged(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); }
/** * INTERNAL: * Update the privately owned parts. */ public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException { if (!this.isForeignKeyRelationship()) { return; } if (!this.shouldObjectModifyCascadeToParts(query)) { return; } // if the target objects are not instantiated, they could not have been changed.... if (!this.isAttributeValueInstantiatedOrChanged(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); }
return; Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession());
Object objects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); ContainerPolicy cp = this.getContainerPolicy();
return; Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession());
return; Object referenceObjects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession());
Object objects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); ContainerPolicy cp = this.getContainerPolicy();
Object objects = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession()); ContainerPolicy cp = this.getContainerPolicy();