/** * INTERNAL: * Return true if the query uses default properties. * This is used to determine if this query is cacheable. * i.e. does not use any properties that may conflict with another query * with the same JPQL or selection criteria. */ @Override public boolean isDefaultPropertiesQuery() { return super.isDefaultPropertiesQuery() && (!hasBatchReadAttributes()) && (!hasHierarchicalExpressions()) && (!this.containerPolicy.isCursorPolicy()); }
/** * INTERNAL: * Return true if the query uses default properties. * This is used to determine if this query is cacheable. * i.e. does not use any properties that may conflict with another query * with the same JPQL or selection criteria. */ @Override public boolean isDefaultPropertiesQuery() { return super.isDefaultPropertiesQuery() && (!hasBatchReadAttributes()) && (!hasHierarchicalExpressions()) && (!this.containerPolicy.isCursorPolicy()); }
/** * INTERNAL: * Return true if the query uses default properties. * This is used to determine if this query is cacheable. * i.e. does not use any properties that may conflict with another query * with the same JPQL or selection criteria. */ public boolean isDefaultPropertiesQuery() { return super.isDefaultPropertiesQuery() && (!hasBatchReadAttributes()) && (!hasHierarchicalExpressions()) && (!getContainerPolicy().isCursorPolicy()); }
if ((!isExpressionQuery()) || (!isDefaultPropertiesQuery())) { return this == object;
if ((!isExpressionQuery()) || (!isDefaultPropertiesQuery())) { return this == object;
if ((!isExpressionQuery()) || (!isDefaultPropertiesQuery())) { return super.equals(object);
/** * Populate the query using the information retrieved from parsing the JPQL. */ public void populateQuery(String jpqlString, ObjectLevelReadQuery query, AbstractSession session) { // PERF: Check if the JPQL has already been parsed. // Only allow queries with default properties to be parse cached. boolean isCacheable = query.isDefaultPropertiesQuery(); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpqlString); } if ((cachedQuery == null) || (!cachedQuery.isPrepared()) || (cachedQuery.getClass() != query.getClass())) { JPQLParser parser = parseEJBQLString(jpqlString); JPQLParseTree parseTree = parser.getParseTree(); parseTree.populateQuery(query, session); if (isCacheable) { session.getProject().getJPQLParseCache().put(jpqlString, query); } } else { query.prepareFromQuery(cachedQuery); query.setIsPrepared(true); } }
/** * Populate the query using the information retrieved from parsing the JPQL. */ public void populateQuery(String jpqlString, ObjectLevelReadQuery query, AbstractSession session) { // PERF: Check if the JPQL has already been parsed. // Only allow queries with default properties to be parse cached. boolean isCacheable = query.isDefaultPropertiesQuery(); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpqlString); } if ((cachedQuery == null) || (!cachedQuery.isPrepared()) || (cachedQuery.getClass() != query.getClass())) { JPQLParser parser = parseEJBQLString(jpqlString); JPQLParseTree parseTree = parser.getParseTree(); parseTree.populateQuery(query, session); if (isCacheable) { session.getProject().getJPQLParseCache().put(jpqlString, query); } } else { query.prepareFromQuery(cachedQuery); query.setIsPrepared(true); } }
/** * Populate the query using the information retrieved from parsing the JPQL. */ public void populateQuery(String jpqlString, ObjectLevelReadQuery query, AbstractSession session) { // PERF: Check if the JPQL has already been parsed. // Only allow queries with default properties to be parse cached. boolean isCacheable = query.isDefaultPropertiesQuery(); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpqlString); } if ((cachedQuery == null) || (!cachedQuery.isPrepared()) || (cachedQuery.getClass() != query.getClass())) { JPQLParser parser = parseEJBQLString(jpqlString); JPQLParseTree parseTree = parser.getParseTree(); parseTree.populateQuery(query, session); if (isCacheable) { session.getProject().getJPQLParseCache().put(jpqlString, query); } } else { query.prepareFromQuery(cachedQuery); query.setIsPrepared(true); } }
/** * INTERNAL: * Check if the query is cached and prepare from it. * Return true if the query was cached. */ protected boolean prepareFromCachedQuery() { // PERF: Check if the equivalent expression query has already been prepared. // Only allow queries with default properties to be cached. boolean isCacheable = isExpressionQuery() && (!getQueryMechanism().isJPQLCallQueryMechanism()) && isDefaultPropertiesQuery() && (!getSession().isHistoricalSession()); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = this.descriptor.getQueryManager().getCachedExpressionQuery(this); } else { return false; } if ((cachedQuery != null) && cachedQuery.isPrepared()) { prepareFromQuery(cachedQuery); setIsPrepared(true); return true; } this.descriptor.getQueryManager().putCachedExpressionQuery(this); this.isCachedExpressionQuery = true; this.isExecutionClone = false; return false; }
/** * INTERNAL: * Check if the query is cached and prepare from it. * Return true if the query was cached. */ protected boolean prepareFromCachedQuery() { // PERF: Check if the equivalent expression query has already been prepared. // Only allow queries with default properties to be cached. boolean isCacheable = isExpressionQuery() && (!getQueryMechanism().isJPQLCallQueryMechanism()) && isDefaultPropertiesQuery() && (!getSession().isHistoricalSession()); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = this.descriptor.getQueryManager().getCachedExpressionQuery(this); } else { return false; } if ((cachedQuery != null) && cachedQuery.isPrepared()) { prepareFromQuery(cachedQuery); setIsPrepared(true); return true; } this.descriptor.getQueryManager().putCachedExpressionQuery(this); this.isExecutionClone = false; return false; }
/** * INTERNAL: * Check if the query is cached and prepare from it. * Return true if the query was cached. */ protected boolean prepareFromCachedQuery() { // PERF: Check if the equivalent expression query has already been prepared. // Only allow queries with default properties to be cached. boolean isCacheable = isExpressionQuery() && (!getQueryMechanism().isJPQLCallQueryMechanism()) && isDefaultPropertiesQuery() && (!getSession().isHistoricalSession()); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = this.descriptor.getQueryManager().getCachedExpressionQuery(this); } else { return false; } if ((cachedQuery != null) && cachedQuery.isPrepared()) { prepareFromQuery(cachedQuery); setIsPrepared(true); return true; } // cuba begin if (org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) { this.descriptor.getQueryManager().putCachedExpressionQuery(this); this.isCachedExpressionQuery = true; this.isExecutionClone = false; } // cuba end return false; }