/** * INTERNAL: * Get a value from the object and set that in the respective field of the row. * But before that check if the reference object is instantiated or not. */ public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord databaseRow) { Object object = query.getObject(); AbstractSession session = query.getSession(); if (!isAttributeValueInstantiated(object)) { return; } if (session.isUnitOfWork()) { if (compareObjectsWithoutPrivateOwned(query.getBackupClone(), object, session)) { return; } } writeFromObjectIntoRow(object, databaseRow, session); }
/** * INTERNAL: * Update privately owned parts */ public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException { if (!isAttributeValueInstantiated(query.getObject())) { return; } if (isPrivateOwned()) { Object objectInDatabase = readPrivateOwnedForObject(query); if (objectInDatabase != null) { query.setProperty(this, objectInDatabase); } } if (!isForeignKeyRelationship()) { return; } update(query); }
/** * INTERNAL: * Get a value from the object and set that in the respective field of the row. */ public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord databaseRow) { if (isReadOnly()) { return; } if (query.isDeleteObjectQuery()) { writeFromObjectIntoRow(query.getObject(), databaseRow, query.getSession()); } else { // If the original was never instantiated the backup clone has a ValueHolder of null // so for this case we must extract from the original object. if (isAttributeValueInstantiated(query.getObject())) { writeFromObjectIntoRow(query.getBackupClone(), databaseRow, query.getSession()); } else { writeFromObjectIntoRow(query.getObject(), databaseRow, query.getSession()); } } }
if (!isAttributeValueInstantiated(query.getObject())) { return;
if (isTargetUnInitialized) { if (mergeManager.shouldMergeWorkingCopyIntoOriginal() && (!isAttributeValueInstantiated(source))) { setAttributeValueInObject(target, getIndirectionPolicy().getOriginalIndirectionObject(getAttributeValueFromObject(source), mergeManager.getSession())); return; if (!isAttributeValueInstantiated(target)) { } else if (!isAttributeValueInstantiated(source)) {
if (!isAttributeValueInstantiated(query.getObject())) { return;