getDescriptor().getObjectBuilder().assignReturnRow(object, getSession(), row);
/** * INTERNAL: * Update the row, object and change set with the version value. * This handles the version being mapped in nested aggregates, writable or read-only. */ protected void updateWriteLockValueForWrite(ObjectLevelModifyQuery query, Object lockValue) { query.getModifyRow().put(getWriteLockField(), lockValue); ObjectChangeSet objectChangeSet = query.getObjectChangeSet(); if (objectChangeSet != null) { objectChangeSet.setWriteLockValue(lockValue); } // CR#3173211 // If the value is stored in the cache or object, there still may // be read-only mappings for it, so the object must always be updated for // any writable or read-only mappings for the version value. // Reuse the method used for returning as has the same requirements. AbstractRecord record = getDescriptor().getObjectBuilder().createRecord(1); record.put(getWriteLockField(), lockValue); getDescriptor().getObjectBuilder().assignReturnRow(query.getObject(), query.getSession(), record); if (query.getSession().isUnitOfWork() && (((UnitOfWorkImpl)query.getSession()).getUnitOfWorkChangeSet() != null)) { if (objectChangeSet == null) { // For aggregate collections the change set may be null, as they use the old commit still. objectChangeSet = (ObjectChangeSet)((UnitOfWorkImpl)query.getSession()).getUnitOfWorkChangeSet().getObjectChangeSetForClone(query.getObject()); } query.getQueryMechanism().updateChangeSet(getDescriptor(), objectChangeSet, record, query.getObject()); } }