/** * INTERNAL: * Prepare the receiver for execution in a session. */ public void prepareForExecution() throws QueryException { super.prepareForExecution(); // For bug 2989998 the translation row now sometimes set earlier in prepare. if (shouldPrepare()) { if (this.selectionId != null) { // Row must come from the key. this.translationRow = this.descriptor.getObjectBuilder().buildRowFromPrimaryKeyValues(this.selectionId, getSession()); } else if (this.selectionObject != null) { // The expression is set in the prepare as params. this.translationRow = this.descriptor.getObjectBuilder().buildRowForTranslation(this.selectionObject, getSession()); } } // If we have tenant discriminator fields we need to add them to the // database row when doing a primary key query. // Modifying the translation row here will modify it on the original // query which is not good (will append the tenant field to the sql call // for subsequent queries) The translation row must be cloned to isolate // this. if (getDescriptor().hasMultitenantPolicy()) { this.translationRow = this.translationRow.clone(); getDescriptor().getMultitenantPolicy().addFieldsToRow(this.translationRow, getSession()); } }
if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { TransformationMappingChangeRecord record = (TransformationMappingChangeRecord)changeSet.getChangesForAttributeNamed(attributeName); if (record == null) {
if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { TransformationMappingChangeRecord record = (TransformationMappingChangeRecord)changeSet.getChangesForAttributeNamed(attributeName); if (record == null) {
/** * INTERNAL: * Prepare the receiver for execution in a session. */ public void prepareForExecution() throws QueryException { super.prepareForExecution(); // For bug 2989998 the translation row now sometimes set earlier in prepare. if (shouldPrepare()) { if (this.selectionId != null) { // Row must come from the key. this.translationRow = this.descriptor.getObjectBuilder().buildRowFromPrimaryKeyValues(this.selectionId, getSession()); } else if (this.selectionObject != null) { // The expression is set in the prepare as params. this.translationRow = this.descriptor.getObjectBuilder().buildRowForTranslation(this.selectionObject, getSession()); } } // If we have tenant discriminator fields we need to add them to the // database row when doing a primary key query. // Modifying the translation row here will modify it on the original // query which is not good (will append the tenant field to the sql call // for subsequent queries) The translation row must be cloned to isolate // this. if (getDescriptor().hasMultitenantPolicy()) { this.translationRow = this.translationRow.clone(); getDescriptor().getMultitenantPolicy().addFieldsToRow(this.translationRow, getSession()); } }
protected Object remoteExecute() { // Do a cache lookup. checkDescriptor(session); // As the selection object is transient, compute the key. if (getSelectionObject() != null) { // Must be checked separately as the expression and row is not yet set. setSelectionKey(getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(getSelectionObject(), session)); } Object cacheHit = checkEarlyReturn(getSession(), getTranslationRow()); if ((cacheHit != null) || shouldCheckCacheOnly()) { return cacheHit; } return super.remoteExecute(); }
setSelectionCriteria(getDescriptor().getObjectBuilder().getPrimaryKeyExpression()); setExpressionBuilder(getSelectionCriteria().getBuilder()); extendPessimisticLockScope(); if (getSelectionKey() != null) { setTranslationRow(getDescriptor().getObjectBuilder().buildRowFromPrimaryKeyValues(getSelectionKey(), getSession())); } else {//(getSelectionObject() != null) setTranslationRow(getDescriptor().getObjectBuilder().buildRowForTranslation(getSelectionObject(), getSession())); if (getDescriptor().isDescriptorForInterface()) { return;
if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { DirectToFieldChangeRecord changeRecord = (DirectToFieldChangeRecord)changeSet.getChangesForAttributeNamed(mapping.getAttributeName()); Object oldAttributeValue = null;
if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { DirectToFieldChangeRecord changeRecord = (DirectToFieldChangeRecord)changeSet.getChangesForAttributeNamed(mapping.getAttributeName()); Object oldAttributeValue = null;
protected Object remoteExecute() { // Do a cache lookup. checkDescriptor(session); // As the selection object is transient, compute the key. if (getSelectionObject() != null) { // Must be checked separately as the expression and row is not yet set. setSelectionId(getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(getSelectionObject(), session)); } Object cacheHit = checkEarlyReturn(getSession(), getTranslationRow()); if ((cacheHit != null) || shouldCheckCacheOnly()) { if (cacheHit == InvalidObject.instance) { return null; } return cacheHit; } return super.remoteExecute(); }
protected Object remoteExecute() { // Do a cache lookup. checkDescriptor(session); // As the selection object is transient, compute the key. if (getSelectionObject() != null) { // Must be checked separately as the expression and row is not yet set. setSelectionId(getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(getSelectionObject(), session)); } Object cacheHit = checkEarlyReturn(getSession(), getTranslationRow()); if ((cacheHit != null) || shouldCheckCacheOnly()) { if (cacheHit == InvalidObject.instance) { return null; } return cacheHit; } return super.remoteExecute(); }
aggregate = readFromRowIntoObject(row, null, targetObject, null, query, query.getSession(), true); } else { if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { aggregateChangeSet = getReferenceDescriptor(aggregate, query.getSession()).getObjectBuilder().createObjectChangeSet(aggregate, (UnitOfWorkChangeSet)((UnitOfWorkImpl)query.getSession()).getUnitOfWorkChangeSet(), true, query.getSession()); if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { AggregateChangeRecord record = (AggregateChangeRecord)changeSet.getChangesForAttributeNamed(getAttributeName()); if(aggregate == null) {
aggregate = readFromRowIntoObject(row, null, targetObject, null, query, query.getSession(), true); } else { if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { aggregateChangeSet = getReferenceDescriptor(aggregate, query.getSession()).getObjectBuilder().createObjectChangeSet(aggregate, (UnitOfWorkChangeSet)((UnitOfWorkImpl)query.getSession()).getUnitOfWorkChangeSet(), true, query.getSession()); if(changeSet != null && (!changeSet.isNew() || (query.getDescriptor() != null && query.getDescriptor().shouldUseFullChangeSetsForNewObjects()))) { AggregateChangeRecord record = (AggregateChangeRecord)changeSet.getChangesForAttributeNamed(getAttributeName()); if(aggregate == null) {