@Override public void printCollection(Vector items, ExpressionSQLPrinter printer) { if (items.size() == 1 && items.get(0) instanceof QueryKeyExpression && "deleteTs".equals(((QueryKeyExpression) items.get(0)).getName())) { if (!CubaUtil.isSoftDeletion()) { try { printer.getWriter().write("(0=0)"); return; } catch (IOException e) { throw new RuntimeException(e); } } } super.printCollection(items, printer); } }
if (org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) {
/** * 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; }
if (!org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) { return null;
if (!org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) { ReadQuery query = (ReadQuery) getQuery().clone(); query.setIsPrepared(false); softDeletionByMapping = oneToOneMapping.isSoftDeletionForValueHolder(); if (softDeletionByMapping && org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) { ReadQuery query = (ReadQuery) getQuery().clone(); query.setIsPrepared(false);
&& org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion() // cuba: do not cache queries when soft delete is disabled
if (isDeleted && CubaUtil.isSoftDeletion()) { Boolean prevSoftDeletion = CubaUtil.setSoftDeletion(false); try {
if (!org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) { if (targetQuery == this.selectionQuery) { targetQuery = (ObjectLevelReadQuery)targetQuery.clone();