/** * 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 * Used to give the subclasses oportunity to copy aspects of the cloned query * to the original query. */ protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session) { if (shouldCacheQueryResults()) { // Cached query results must exist on the original query rather than the cloned one setQueryResults(((ReadQuery)query).getTemporaryCachedQueryResults(), query.getTranslationRow(), query.getSession()); } }
/** * INTERNAL * Used to give the subclasses opportunity to copy aspects of the cloned query * to the original query. */ protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session) { if (shouldCacheQueryResults()) { Object result = ((ReadQuery)query).getTemporaryCachedQueryResults(); // If the temporary results were never set, then don't cache null. if (result != null) { // Cached query results must exist on the original query rather than the cloned one. setQueryResults(result, query.getTranslationRow(), query.getSession()); } } }
/** * INTERNAL * Used to give the subclasses opportunity to copy aspects of the cloned query * to the original query. */ protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session) { if (shouldCacheQueryResults()) { Object result = ((ReadQuery)query).getTemporaryCachedQueryResults(); // If the temporary results were never set, then don't cache null. if (result != null) { // Cached query results must exist on the original query rather than the cloned one. setQueryResults(result, query.getTranslationRow(), query.getSession()); } } }
/** * INTERNAL: * Return if this is a read query. */ public Object remoteExecute(AbstractSession session) throws DatabaseException { if (shouldCacheQueryResults()) { AbstractRecord arguments = new DatabaseRecord(); if (translationRow != null){ arguments = translationRow; } Object queryResults = getQueryResults(session, arguments, true); if (queryResults != null) { return queryResults; } queryResults = super.remoteExecute(session); if (queryResults != null){ setQueryResults(queryResults, arguments, session); } return queryResults; } return super.remoteExecute(session); }
/** * 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: * Return if this is a read query. */ public Object remoteExecute(AbstractSession session) throws DatabaseException { if (shouldCacheQueryResults()) { AbstractRecord arguments = new DatabaseRecord(); if (translationRow != null){ arguments = translationRow; } Object queryResults = getQueryResults(session, arguments, true); if (queryResults != null) { return queryResults; } queryResults = super.remoteExecute(session); if (queryResults != null){ setQueryResults(queryResults, arguments, session); } return queryResults; } return super.remoteExecute(session); }
/** * INTERNAL: * Return if this is a read query. */ public Object remoteExecute(AbstractSession session) throws DatabaseException { if (shouldCacheQueryResults()) { AbstractRecord arguments = new DatabaseRecord(); if (translationRow != null){ arguments = translationRow; } Object queryResults = getQueryResults(session, arguments, true); if (queryResults != null) { return queryResults; } queryResults = super.remoteExecute(session); if (queryResults != null){ setQueryResults(queryResults, arguments, session); } return queryResults; } return super.remoteExecute(session); }
if (query.isReadQuery() && (query.getDescriptor() != null) && !query.getDescriptor().getCachePolicy().isIsolated()) { ReadQuery readQuery = (ReadQuery)query; if (!readQuery.shouldCacheQueryResults()) { readQuery.setQueryResultsCachePolicy(defaultQueryCachePolicy.clone());
if (query.isReadQuery() && (query.getDescriptor() != null) && !query.getDescriptor().getCachePolicy().isIsolated()) { ReadQuery readQuery = (ReadQuery)query; if (!readQuery.shouldCacheQueryResults()) { readQuery.setQueryResultsCachePolicy(defaultQueryCachePolicy.clone());
if (query.isReadQuery()) { ReadQuery readQuery = (ReadQuery)query; if (!readQuery.shouldCacheQueryResults()) { readQuery.setQueryResultsCachePolicy(defaultQueryCachePolicy.clone());
if (query.isReadQuery()) { ReadQuery readQuery = (ReadQuery)query; if (!readQuery.shouldCacheQueryResults()) { readQuery.setQueryResultsCachePolicy(defaultQueryCachePolicy.clone());
if (readQuery.shouldCacheQueryResults()) { method.addLine(queryIdentifier + ".setQueryResultsCachePolicy(new QueryResultsCachePolicy());");
if (readQuery.shouldCacheQueryResults()) { method.addLine(queryIdentifier + ".setQueryResultsCachePolicy(new QueryResultsCachePolicy());");
if (readQuery.shouldCacheQueryResults()) { method.addLine(queryIdentifier + ".setQueryResultsCachePolicy(new QueryResultsCachePolicy());");
if ((query != null) && query.shouldCacheQueryResults()) { if ((mapping != null) && (mapping.getReferenceDescriptor() != null) && (mapping.getReferenceDescriptor().getJavaClass() != null)) { query.getQueryResultsCachePolicy().getInvalidationClasses().add(mapping.getReferenceDescriptor().getJavaClass());
if ((query != null) && query.shouldCacheQueryResults()) { if ((mapping != null) && (mapping.getReferenceDescriptor() != null) && (mapping.getReferenceDescriptor().getJavaClass() != null)) { query.getQueryResultsCachePolicy().getInvalidationClasses().add(mapping.getReferenceDescriptor().getJavaClass());
if ((query != null) && query.shouldCacheQueryResults()) { if (this.queryClass != null) { query.getQueryResultsCachePolicy().getInvalidationClasses().add(this.queryClass);
if ((query != null) && query.shouldCacheQueryResults()) { if (this.queryClass != null) { query.getQueryResultsCachePolicy().getInvalidationClasses().add(this.queryClass);