Object result = null; if (!shouldMaintainCache() || isReadOnly()) { result = unitOfWork.getParent().executeQuery(this, translationRow); } else {
Object result = null; if (!shouldMaintainCache() || isReadOnly()) { result = unitOfWork.getParent().executeQuery(this, translationRow); } else {
/** * If the reference object is mapped thru one to one mapping and the object derives its primary key value * from this relationship then remote value holder has a primary key row for. */ protected boolean canDoCacheCheck() { if ((getMapping() == null) || (getQuery() == null)) { return false; } return (getTargetObjectPrimaryKeys() != null) && (!getTargetObjectPrimaryKeys().isEmpty()) && getMapping().isOneToOneMapping() && (!getQuery().shouldRefreshIdentityMapResult()) && (!getQuery().shouldRefreshRemoteIdentityMapResult()) && (getQuery().shouldMaintainCache()); }
fetchedFields.add(getDescriptor().getInheritancePolicy().getClassIndicatorField()); if (shouldMaintainCache() && getDescriptor().usesOptimisticLocking()) { DatabaseField lockField = getDescriptor().getOptimisticLockingPolicy().getWriteLockField(); if (lockField != null) {
/** * INTERNAL: * We are not using a remote valueholder * so we need to replace the reference object(s) with * the corresponding object(s) from the remote session. */ @Override public void fixRealObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { //bug 4147755 getRealAttribute... / setReal Object attributeValue = getRealAttributeValueFromObject(object, session); // the object collection could be null, check here to avoid NPE if (attributeValue == null) { setAttributeValueInObject(object, null); return; } ObjectLevelReadQuery tempQuery = query; if (!tempQuery.shouldMaintainCache()) { if ((!tempQuery.shouldCascadeParts()) || (tempQuery.shouldCascadePrivateParts() && (!isPrivateOwned()))) { tempQuery = null; } } Object remoteAttributeValue = session.getObjectsCorrespondingToAll(attributeValue, objectDescriptors, processedObjects, tempQuery, this.containerPolicy); setRealAttributeValueInObject(object, remoteAttributeValue); }
/** * If the reference object is mapped thru one to one mapping and the object derives its primary key value * from this relationship then remote value holder has a primary key row for. */ protected boolean canDoCacheCheck() { if ((getMapping() == null) || (getQuery() == null)) { return false; } return (getTargetObjectPrimaryKeys() != null) && getMapping().isOneToOneMapping() && (!getQuery().shouldRefreshIdentityMapResult()) && (!getQuery().shouldRefreshRemoteIdentityMapResult()) && (getQuery().shouldMaintainCache()); }
/** * INTERNAL: * We are not using a remote valueholder * so we need to replace the reference object(s) with * the corresponding object(s) from the remote session. */ public void fixRealObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, RemoteSession session) { //bug 4147755 getRealAttribute... / setReal Object attributeValue = getRealAttributeValueFromObject(object, session); // the object collection could be null, check here to avoid NPE if (attributeValue == null) { setAttributeValueInObject(object, null); return; } ObjectLevelReadQuery tempQuery = query; if (!tempQuery.shouldMaintainCache()) { if ((!tempQuery.shouldCascadeParts()) || (tempQuery.shouldCascadePrivateParts() && (!isPrivateOwned()))) { tempQuery = null; } } Object remoteAttributeValue = session.getObjectsCorrespondingToAll(attributeValue, objectDescriptors, processedObjects, tempQuery, this.containerPolicy); setRealAttributeValueInObject(object, remoteAttributeValue); }
/** * INTERNAL: * We are not using a remote valueholder * so we need to replace the reference object(s) with * the corresponding object(s) from the remote session. */ @Override public void fixRealObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { //bug 4147755 getRealAttribute... / setReal Object attributeValue = getRealAttributeValueFromObject(object, session); // the object collection could be null, check here to avoid NPE if (attributeValue == null) { setAttributeValueInObject(object, null); return; } ObjectLevelReadQuery tempQuery = query; if (!tempQuery.shouldMaintainCache()) { if ((!tempQuery.shouldCascadeParts()) || (tempQuery.shouldCascadePrivateParts() && (!isPrivateOwned()))) { tempQuery = null; } } Object remoteAttributeValue = session.getObjectsCorrespondingToAll(attributeValue, objectDescriptors, processedObjects, tempQuery, this.containerPolicy); setRealAttributeValueInObject(object, remoteAttributeValue); }
/** * If the reference object is mapped thru one to one mapping and the object derives its primary key value * from this relationship then remote value holder has a primary key row for. */ protected boolean canDoCacheCheck() { if ((getMapping() == null) || (getQuery() == null)) { return false; } return (getTargetObjectPrimaryKeys() != null) && getMapping().isOneToOneMapping() && (!getQuery().shouldRefreshIdentityMapResult()) && (!getQuery().shouldRefreshRemoteIdentityMapResult()) && (getQuery().shouldMaintainCache()); }
fetchedFields.add(getDescriptor().getInheritancePolicy().getClassIndicatorField()); if (shouldMaintainCache() && getDescriptor().usesOptimisticLocking()) { DatabaseField lockField = getDescriptor().getOptimisticLockingPolicy().getWriteLockField(); if (lockField != null) {
/** * INTERNAL: * An object has been serialized from the server to the client. * Replace the transient attributes of the remote value holders * with client-side objects. */ public void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { Object attributeValue = this.mapping.getAttributeValueFromObject(object); //bug 4147755 if it is not a Remote Valueholder then treat as if there was no VH... if (attributeValue instanceof RemoteValueHolder){ RemoteValueHolder rvh = (RemoteValueHolder)this.mapping.getAttributeValueFromObject(object); rvh.setSession(session); rvh.setMapping(this.mapping); if ((!query.shouldMaintainCache()) && ((!query.shouldCascadeParts()) || (query.shouldCascadePrivateParts() && (!this.mapping.isPrivateOwned())))) { rvh.setQuery(null); } else { rvh.setQuery(query); } // set to uninstantiated since no objects are serialized past remote value holders rvh.setUninstantiated(); }else{ this.mapping.fixRealObjectReferences(object, objectDescriptors, processedObjects, query, session); } }
/** * INTERNAL: * An object has been serialized from the server to the client. * Replace the transient attributes of the remote value holders * with client-side objects. */ public void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { Object attributeValue = this.mapping.getAttributeValueFromObject(object); //bug 4147755 if it is not a Remote Valueholder then treat as if there was no VH... if (attributeValue instanceof RemoteValueHolder){ RemoteValueHolder rvh = (RemoteValueHolder)this.mapping.getAttributeValueFromObject(object); rvh.setSession(session); rvh.setMapping(this.mapping); if ((!query.shouldMaintainCache()) && ((!query.shouldCascadeParts()) || (query.shouldCascadePrivateParts() && (!this.mapping.isPrivateOwned())))) { rvh.setQuery(null); } else { rvh.setQuery(query); } // set to uninstantiated since no objects are serialized past remote value holders rvh.setUninstantiated(); }else{ this.mapping.fixRealObjectReferences(object, objectDescriptors, processedObjects, query, session); } }
if (query.shouldMaintainCache() && getDescriptor().usesOptimisticLocking()) { DatabaseField lockField = getDescriptor().getOptimisticLockingPolicy().getWriteLockField(); if (lockField != null) {
/** * INTERNAL: * We are not using a remote valueholder * so we need to replace the reference object(s) with * the corresponding object(s) from the remote session. * * ObjectReferenceMappings need to unwrap and wrap the * reference object. */ public void fixRealObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, RemoteSession session) { //bug 4147755 getRealAttribute... / setReal... Object attributeValue = getRealAttributeValueFromObject(object, session); attributeValue = getReferenceDescriptor().getObjectBuilder().unwrapObject(attributeValue, session); ObjectLevelReadQuery tempQuery = query; if (!tempQuery.shouldMaintainCache()) { if ((!tempQuery.shouldCascadeParts()) || (tempQuery.shouldCascadePrivateParts() && (!isPrivateOwned()))) { tempQuery = null; } } Object remoteAttributeValue = session.getObjectCorrespondingTo(attributeValue, objectDescriptors, processedObjects, tempQuery); remoteAttributeValue = getReferenceDescriptor().getObjectBuilder().wrapObject(remoteAttributeValue, session); setRealAttributeValueInObject(object, remoteAttributeValue); }
/** * INTERNAL: * We are not using a remote valueholder * so we need to replace the reference object(s) with * the corresponding object(s) from the remote session. * * ObjectReferenceMappings need to unwrap and wrap the * reference object. */ @Override public void fixRealObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { //bug 4147755 getRealAttribute... / setReal... Object attributeValue = getRealAttributeValueFromObject(object, session); attributeValue = getReferenceDescriptor().getObjectBuilder().unwrapObject(attributeValue, session); ObjectLevelReadQuery tempQuery = query; if (!tempQuery.shouldMaintainCache()) { if ((!tempQuery.shouldCascadeParts()) || (tempQuery.shouldCascadePrivateParts() && (!isPrivateOwned()))) { tempQuery = null; } } Object remoteAttributeValue = session.getObjectCorrespondingTo(attributeValue, objectDescriptors, processedObjects, tempQuery); remoteAttributeValue = getReferenceDescriptor().getObjectBuilder().wrapObject(remoteAttributeValue, session); setRealAttributeValueInObject(object, remoteAttributeValue); }
/** * INTERNAL: * We are not using a remote valueholder * so we need to replace the reference object(s) with * the corresponding object(s) from the remote session. * * ObjectReferenceMappings need to unwrap and wrap the * reference object. */ @Override public void fixRealObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { //bug 4147755 getRealAttribute... / setReal... Object attributeValue = getRealAttributeValueFromObject(object, session); attributeValue = getReferenceDescriptor().getObjectBuilder().unwrapObject(attributeValue, session); ObjectLevelReadQuery tempQuery = query; if (!tempQuery.shouldMaintainCache()) { if ((!tempQuery.shouldCascadeParts()) || (tempQuery.shouldCascadePrivateParts() && (!isPrivateOwned()))) { tempQuery = null; } } Object remoteAttributeValue = session.getObjectCorrespondingTo(attributeValue, objectDescriptors, processedObjects, tempQuery); remoteAttributeValue = getReferenceDescriptor().getObjectBuilder().wrapObject(remoteAttributeValue, session); setRealAttributeValueInObject(object, remoteAttributeValue); }
/** * INTERNAL: * An object has been serialized from the server to the client. * Replace the transient attributes of the remote value holders * with client-side objects. */ public void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { Object container = getMapping().getAttributeValueFromObject(object); if (container instanceof IndirectContainer && ((((IndirectContainer) container).getValueHolder() instanceof RemoteValueHolder)) ) { RemoteValueHolder valueHolder = (RemoteValueHolder)((IndirectContainer)container).getValueHolder(); valueHolder.setSession(session); valueHolder.setMapping(getMapping()); if ((!query.shouldMaintainCache()) && ((!query.shouldCascadeParts()) || (query.shouldCascadePrivateParts() && (!this.mapping.isPrivateOwned())))) { valueHolder.setQuery(null); } else { valueHolder.setQuery(query); } // set to uninstantiated since no objects are serialized past remote value holders valueHolder.setUninstantiated(); } else { this.mapping.fixRealObjectReferences(object, objectDescriptors, processedObjects, query, session); } }
/** * INTERNAL: * An object has been serialized from the server to the client. * Replace the transient attributes of the remote value holders * with client-side objects. */ public void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { Object container = getMapping().getAttributeValueFromObject(object); if (container instanceof IndirectContainer && ((((IndirectContainer) container).getValueHolder() instanceof RemoteValueHolder)) ) { RemoteValueHolder valueHolder = (RemoteValueHolder)((IndirectContainer)container).getValueHolder(); valueHolder.setSession(session); valueHolder.setMapping(getMapping()); if ((!query.shouldMaintainCache()) && ((!query.shouldCascadeParts()) || (query.shouldCascadePrivateParts() && (!this.mapping.isPrivateOwned())))) { valueHolder.setQuery(null); } else { valueHolder.setQuery(query); } // set to uninstantiated since no objects are serialized past remote value holders valueHolder.setUninstantiated(); } else { this.mapping.fixRealObjectReferences(object, objectDescriptors, processedObjects, query, session); } }
/** * INTERNAL: * An object has been serialized from the server to the client. * Replace the transient attributes of the remote value holders * with client-side objects. */ public void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, RemoteSession session) { Object container = getMapping().getAttributeValueFromObject(object); //There may have been a concurrent modifucation of the collection on the server side // and the valueholders would not have been updated so treat it like no indirection if (container instanceof IndirectContainer || (!(((IndirectContainer) container).getValueHolder() instanceof RemoteValueHolder)) ) { RemoteValueHolder valueHolder = (RemoteValueHolder)((IndirectContainer)container).getValueHolder(); valueHolder.setSession(session); valueHolder.setMapping(getMapping()); if ((!query.shouldMaintainCache()) && ((!query.shouldCascadeParts()) || (query.shouldCascadePrivateParts() && (!getMapping().isPrivateOwned())))) { valueHolder.setQuery(null); } else { valueHolder.setQuery(query); } // set to uninstantiated since no objects are serialized past remote value holders valueHolder.setUninstantiated(); } else { getMapping().fixRealObjectReferences(object, objectDescriptors, processedObjects, query, session); } }
/** * INTERNAL: * An object has been serialized from the server to the client. * Replace the transient attributes of the remote value holders * with client-side objects. */ public void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, RemoteSession session) { Object attributeValue = this.getMapping().getAttributeValueFromObject(object); //bug 4147755 if it is not a Remote Valueholder then treat as if there was no VH... if (attributeValue instanceof RemoteValueHolder){ RemoteValueHolder rvh = (RemoteValueHolder)this.getMapping().getAttributeValueFromObject(object); rvh.setSession(session); rvh.setMapping(this.getMapping()); if ((!query.shouldMaintainCache()) && ((!query.shouldCascadeParts()) || (query.shouldCascadePrivateParts() && (!getMapping().isPrivateOwned())))) { rvh.setQuery(null); } else { rvh.setQuery(query); } // set to uninstantiated since no objects are serialized past remote value holders rvh.setUninstantiated(); }else{ this.getMapping().fixRealObjectReferences(object, objectDescriptors, processedObjects, query, session); } }