/** * INTERNAL: * Compute a consistent hash-code for the expression. * This is used to allow dynamic expression's SQL to be cached. */ public int computeHashCode() { int hashCode = super.computeHashCode(); if (this.operator != null) { hashCode = hashCode + this.operator.hashCode(); } List children = getChildren(); int size = children.size(); for (int index = 0; index < size; index++) { hashCode = hashCode + children.get(index).hashCode(); } return hashCode; }
/** * INTERNAL: * Search the tree for any expressions (like SubSelectExpressions) that have been * built using a builder that is not attached to the query. This happens in case of an Exists * call using a new ExpressionBuilder(). This builder needs to be replaced with one from the query. */ public void resetPlaceHolderBuilder(ExpressionBuilder queryBuilder){ if (getBaseExpression() != null){ getBaseExpression().resetPlaceHolderBuilder(queryBuilder); } }
/** * INTERNAL: * For iterating using an inner class */ @Override public void iterateOn(ExpressionIterator iterator) { super.iterateOn(iterator); for (Enumeration<Expression> childrenEnum = this.children.elements(); childrenEnum.hasMoreElements();) { Expression child = childrenEnum.nextElement(); child.iterateOn(iterator); } }
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); Vector oldChildren = children; children = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(); for (int i = 0; i < oldChildren.size(); i++) { addChild((((Expression)oldChildren.elementAt(i)).copiedVersionFrom(alreadyDone))); } }
return true; if (!super.equals(object)) { return false;
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); if (this.baseExpression != null) { setBaseExpression(this.baseExpression.copiedVersionFrom(alreadyDone)); } }
/** * INTERNAL: * Normalize the expression into a printable structure. * Any joins must be added to form a new root. */ @Override public Expression normalize(ExpressionNormalizer normalizer) { if (this.hasBeenNormalized) { return this; } this.hasBeenNormalized = true; if (this.baseExpression != null) { // First normalize the base. setBaseExpression(this.baseExpression.normalize(normalizer)); if (getAsOfClause() == null) { asOf(this.baseExpression.getAsOfClause()); } } return super.normalize(normalizer); }
/** * INTERNAL: * Used for cloning. */ @Override protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); Vector<Expression> oldChildren = this.children; this.children = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(); for (int i = 0; i < oldChildren.size(); i++) { addChild((oldChildren.elementAt(i).copiedVersionFrom(alreadyDone))); } }
return true; if (!super.equals(object)) { return false;
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); if (this.baseExpression != null) { setBaseExpression(this.baseExpression.copiedVersionFrom(alreadyDone)); } }
/** * INTERNAL: * Normalize the expression into a printable structure. * Any joins must be added to form a new root. */ @Override public Expression normalize(ExpressionNormalizer normalizer) { if (this.hasBeenNormalized) { return this; } this.hasBeenNormalized = true; if (this.baseExpression != null) { // First normalize the base. setBaseExpression(this.baseExpression.normalize(normalizer)); if (getAsOfClause() == null) { asOf(this.baseExpression.getAsOfClause()); } } return super.normalize(normalizer); }
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); Vector oldChildren = children; children = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(); for (int i = 0; i < oldChildren.size(); i++) { addChild((((Expression)oldChildren.elementAt(i)).copiedVersionFrom(alreadyDone))); } }
/** * INTERNAL: * For iterating using an inner class */ @Override public void iterateOn(ExpressionIterator iterator) { super.iterateOn(iterator); if (baseExpression != null) { baseExpression.iterateOn(iterator); } }
/** * PUBLIC: A logical expression for the size of collection expression. * <p>Example: * <blockquote><pre> * EclipseLink: employee.size(Class returnType) * Java: employee.getPhoneNumbers().size() * SQL: SELECT ... FROM EMP t0 WHERE ... * (SELECT COUNT(*) FROM PHONE t1 WHERE (t0.EMP_ID = t1.EMP_ID)) * </pre></blockquote> * This is a case where a fast operation in java does not translate to an * equally fast operation in SQL, requiring a correlated subselect. */ public Expression size(Class returnType) { if (((BaseExpression)this).getBaseExpression() == null){ return SubSelectExpression.createSubSelectExpressionForCount(this, this, null, returnType); } return SubSelectExpression.createSubSelectExpressionForCount(((BaseExpression)this).getBaseExpression(), this, null, returnType); }
return true; if (!super.equals(object)) { return false;
/** * INTERNAL: * Compute a consistent hash-code for the expression. * This is used to allow dynamic expression's SQL to be cached. */ @Override public int computeHashCode() { int hashCode = super.computeHashCode(); if (this.operator != null) { hashCode = hashCode + this.operator.hashCode(); } List<?> children = getChildren(); int size = children.size(); for (int index = 0; index < size; index++) { hashCode = hashCode + children.get(index).hashCode(); } return hashCode; }
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); if (this.baseExpression != null) { setBaseExpression(this.baseExpression.copiedVersionFrom(alreadyDone)); } }
/** * INTERNAL: * Normalize the expression into a printable structure. * Any joins must be added to form a new root. */ public Expression normalize(ExpressionNormalizer normalizer) { if (getBaseExpression() != null) { // First normalize the base. setBaseExpression(getBaseExpression().normalize(normalizer)); if (getAsOfClause() == null) { asOf(getBaseExpression().getAsOfClause()); } } return super.normalize(normalizer); }
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); clearAliases(); derivedFields = copyCollection(derivedFields, alreadyDone); derivedTables = copyCollection(derivedTables, alreadyDone); }
/** * INTERNAL: * For iterating using an inner class */ @Override public void iterateOn(ExpressionIterator iterator) { super.iterateOn(iterator); if (baseExpression != null) { baseExpression.iterateOn(iterator); } }