/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * INTERNAL: * This is different from 'prepareForExecution' in that this is called on the original query, * and the other is called on the copy of the query. * This query is copied for concurrency so this prepare can only setup things that * will apply to any future execution of this query. * * Clear the query cache when a query is prepared. */ protected void prepare() throws QueryException { super.prepare(); if (shouldCacheQueryResults()){ clearQueryResults(getSession()); } }
/** * INTERNAL: */ public Cursor(DatabaseCall call, CursorPolicy policy) { ReadQuery query = policy.getQuery(); this.query = query; this.session = query.getSession(); this.executionSession = session.getExecutionSession(query); this.statement = call.getStatement(); this.fields = call.getFields(); this.resultSet = call.getResult(); this.policy = policy; this.objectCollection = new Vector(); if (query.getSession().isUnitOfWork() && query.isObjectLevelReadQuery()) { // Call register on the cursor itself. This will set up // incremental conforming by setting the // selection criteria clone and arguments, and building the // intially conforming index (scans the UOW cache). // The incremental registration/conforming is done // in retrieveNext/PreviousObject -> buildAndRegisterObject ((ObjectLevelReadQuery)query).registerResultInUnitOfWork(this, (UnitOfWorkImpl)this.session, query.getTranslationRow(), false);// object collection is empty, so setting irrelevant. } }
/** * INTERNAL: */ public Cursor(DatabaseCall call, CursorPolicy policy) { ReadQuery query = policy.getQuery(); this.query = query; this.session = query.getSession(); this.executionSession = session.getExecutionSession(query); this.statement = call.getStatement(); this.fields = call.getFields(); this.resultSet = call.getResult(); this.policy = policy; this.objectCollection = new Vector(); if (query.getSession().isUnitOfWork() && query.isObjectLevelReadQuery()) { // Call register on the cursor itself. This will set up // incremental conforming by setting the // selection criteria clone and arguments, and building the // intially conforming index (scans the UOW cache). // The incremental registration/conforming is done // in retrieveNext/PreviousObject -> buildAndRegisterObject ((ObjectLevelReadQuery)query).registerResultInUnitOfWork(this, (UnitOfWorkImpl)this.session, query.getTranslationRow(), false);// object collection is empty, so setting irrelevant. } }
/** * INTERNAL: * This is different from 'prepareForExecution' in that this is called on the original query, * and the other is called on the copy of the query. * This query is copied for concurrency so this prepare can only setup things that * will apply to any future execution of this query. * * Clear the query cache when a query is prepared. */ protected void prepare() throws QueryException { super.prepare(); if (shouldCacheQueryResults()) { clearQueryResults(getSession()); if (getReferenceClass() != null) { getQueryResultsCachePolicy().getInvalidationClasses().add(getReferenceClass()); } } }
/** * INTERNAL: * This is different from 'prepareForExecution' in that this is called on the original query, * and the other is called on the copy of the query. * This query is copied for concurrency so this prepare can only setup things that * will apply to any future execution of this query. * * Clear the query cache when a query is prepared. */ protected void prepare() throws QueryException { super.prepare(); if (shouldCacheQueryResults()) { clearQueryResults(getSession()); if (getReferenceClass() != null) { getQueryResultsCachePolicy().getInvalidationClasses().add(getReferenceClass()); } } }
/** * INTERNAL: */ public Cursor(DatabaseCall call, CursorPolicy policy) { this.session = policy.getQuery().getSession(); this.executionSession = session.getExecutionSession(policy.getQuery()); this.statement = call.getStatement(); this.fields = call.getFields(); this.resultSet = call.getResult(); this.policy = policy; setObjectCollection(new Vector()); if (getQuery().getSession().isUnitOfWork() && getQuery().isObjectLevelReadQuery()) { // Call register on the cursor itself. This will set up // incremental conforming by setting the // selection criteria clone and arguments, and building the // intially conforming index (scans the UOW cache). // The incremental registration/conforming is done // in retrieveNext/PreviousObject -> buildAndRegisterObject ObjectLevelReadQuery query = (ObjectLevelReadQuery)getQuery(); query.registerResultInUnitOfWork(this, (UnitOfWorkImpl)this.session, getQuery().getTranslationRow(), false);// object collection is empty, so setting irrelevant. } }
/** * INTERNAL: * Allow the mapping the do any further batch preparation. */ @Override protected void postPrepareNestedBatchQuery(ReadQuery batchQuery, ObjectLevelReadQuery query) { super.postPrepareNestedBatchQuery(batchQuery, query); // Force a distinct to filter out m-1 duplicates. // Only set if really a m-1, not a 1-1 if (!this.isOneToOneRelationship && ((ObjectLevelReadQuery)batchQuery).getBatchFetchPolicy().isJOIN()) { if (!((ObjectLevelReadQuery)batchQuery).isDistinctComputed() && (batchQuery.getSession().getPlatform().isLobCompatibleWithDistinct() || !Helper.hasLob(batchQuery.getDescriptor().getSelectionFields((ObjectLevelReadQuery)batchQuery)))) { ((ObjectLevelReadQuery)batchQuery).useDistinct(); } } if (this.mechanism != null) { this.mechanism.postPrepareNestedBatchQuery(batchQuery, query); } }
/** * INTERNAL: * Allow the mapping the do any further batch preparation. */ @Override protected void postPrepareNestedBatchQuery(ReadQuery batchQuery, ObjectLevelReadQuery query) { super.postPrepareNestedBatchQuery(batchQuery, query); // Force a distinct to filter out m-1 duplicates. // Only set if really a m-1, not a 1-1 if (!this.isOneToOneRelationship && ((ObjectLevelReadQuery)batchQuery).getBatchFetchPolicy().isJOIN()) { if (!((ObjectLevelReadQuery)batchQuery).isDistinctComputed() && (batchQuery.getSession().getPlatform().isLobCompatibleWithDistinct() || !Helper.hasLob(batchQuery.getDescriptor().getSelectionFields((ObjectLevelReadQuery)batchQuery)))) { ((ObjectLevelReadQuery)batchQuery).useDistinct(); } } if (this.mechanism != null) { this.mechanism.postPrepareNestedBatchQuery(batchQuery, query); } }