/** * INTERNAL: * Compute a consistent hash-code for the expression. * This is used to allow dynamic expression's SQL to be cached. */ @Override public int hashCode() { if (!isExpressionQuery()) { return super.hashCode(); } int hashCode = 32; if (this.referenceClass != null) { hashCode = hashCode + this.referenceClass.hashCode(); } Expression selectionCriteria = getSelectionCriteria(); if (selectionCriteria != null) { hashCode = hashCode + selectionCriteria.hashCode(); } return hashCode; }
/** * INTERNAL: * Compute a consistent hash-code for the expression. * This is used to allow dynamic expression's SQL to be cached. */ @Override public int hashCode() { if (!isExpressionQuery()) { return super.hashCode(); } int hashCode = 32; if (this.referenceClass != null) { hashCode = hashCode + this.referenceClass.hashCode(); } Expression selectionCriteria = getSelectionCriteria(); if (selectionCriteria != null) { hashCode = hashCode + selectionCriteria.hashCode(); } return hashCode; }
/** * INTERNAL: * Compute a consistent hash-code for the expression. * This is used to allow dynamic expression's SQL to be cached. */ public int hashCode() { if (!isExpressionQuery()) { return super.hashCode(); } int hashCode = 32; if (getReferenceClass() != null) { hashCode = hashCode + getReferenceClass().hashCode(); } if (getSelectionCriteria() != null) { hashCode = hashCode + getSelectionCriteria().hashCode(); } return hashCode; }
if ((!isExpressionQuery()) || (!isDefaultPropertiesQuery())) { return this == object;
if ((!isExpressionQuery()) || (!isDefaultPropertiesQuery())) { return this == object;
if ((!isExpressionQuery()) || (!isDefaultPropertiesQuery())) { return super.equals(object);
if (!isExpressionQuery() || (selectionCriteriaClone == null) || isPrimaryKeyQuery()) { if (alreadyReturned != null) { alreadyReturned.remove(clone);
if (!isExpressionQuery() || (selectionCriteriaClone == null) || isPrimaryKeyQuery()) { if (alreadyReturned != null) { alreadyReturned.remove(clone);
if (!isExpressionQuery() || (selectionCriteriaClone == null) || isPrimaryKeyQuery()) { if (alreadyReturned != null) { alreadyReturned.remove(clone);
/** * 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; }