/** * INTERNAL: Not to be confused with the public getField(String) * This returns a collection of all fields associated with this object. Really * only applies to query keys representing an object or to expression builders. * */ @Override public Vector getFields() { return getBaseExpression().getFields(); }
/** * INTERNAL: */ @Override public List<DatabaseField> getSelectionFields(ReadQuery query) { return getBaseExpression().getSelectionFields(query); }
/** * INTERNAL: Not to be confused with the public getField(String) * This returns a collection of all fields associated with this object. Really * only applies to query keys representing an object or to expression builders. * */ @Override public Vector getFields() { return getBaseExpression().getFields(); }
/** * INTERNAL: * Find the alias for a given table */ public DatabaseTable aliasForTable(DatabaseTable table) { return getBaseExpression().aliasForTable(table); }
@Override public void setLocalBase(Expression exp) { getBaseExpression().setLocalBase(exp); }
/** * INTERNAL: Not to be confused with the public getField(String) * This returns a collection of all fields associated with this object. Really * only applies to query keys representing an object or to expression builders. * */ public Vector getFields() { return getBaseExpression().getFields(); }
/** * INTERNAL: * Find the alias for a given table */ @Override public DatabaseTable aliasForTable(DatabaseTable table) { return getBaseExpression().aliasForTable(table); }
/** * INTERNAL: */ @Override public List<DatabaseField> getSelectionFields(ReadQuery query) { return getBaseExpression().getSelectionFields(query); }
/** * INTERNAL: * Find the alias for a given table */ public DatabaseTable aliasForTable(DatabaseTable table) { return getBaseExpression().aliasForTable(table); }
public void setLocalBase(Expression exp) { getBaseExpression().setLocalBase(exp); }
public void setLocalBase(Expression exp) { getBaseExpression().setLocalBase(exp); }
/** * 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){ getBaseExpression().resetPlaceHolderBuilder(queryBuilder); for (int i = this.children.size()-1; i > 0; i--) {// Skip the first one, since it's also the base ((Expression)children.elementAt(i)).resetPlaceHolderBuilder(queryBuilder); } } // Set the local base expression, ie the one on the other side of the operator
/** * 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){ getBaseExpression().resetPlaceHolderBuilder(queryBuilder); for (int i = this.children.size()-1; i > 0; i--) {// Skip the first one, since it's also the base ((Expression)children.elementAt(i)).resetPlaceHolderBuilder(queryBuilder); } } // Set the local base expression, ie the one on the other side of the operator
/** * 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. */ @Override public void resetPlaceHolderBuilder(ExpressionBuilder queryBuilder){ getBaseExpression().resetPlaceHolderBuilder(queryBuilder); for (int i = this.children.size()-1; i > 0; i--) {// Skip the first one, since it's also the base this.children.elementAt(i).resetPlaceHolderBuilder(queryBuilder); } } // Set the local base expression, ie the one on the other side of the operator
/** * INTERNAL: * This expression is built on a different base than the one we want. Rebuild it and * return the root of the new tree */ public Expression rebuildOn(Expression newBase) { Expression newLocalBase = getBaseExpression().rebuildOn(newBase); Vector newChildren = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(this.children.size()); for (int i = 1; i < this.children.size(); i++) {// Skip the first one, since it's also the base newChildren.addElement(((Expression)children.elementAt(i)).rebuildOn(newBase)); } newLocalBase.setSelectIfOrderedBy(getBaseExpression().selectIfOrderedBy()); FunctionExpression rebuilt = (FunctionExpression) newLocalBase.performOperator(this.operator, newChildren); rebuilt.setResultType(this.getResultType()); //copy over result type. return rebuilt; }
/** * INTERNAL: * This expression is built on a different base than the one we want. Rebuild it and * return the root of the new tree */ public Expression rebuildOn(Expression newBase) { Expression newLocalBase = getBaseExpression().rebuildOn(newBase); Vector newChildren = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(this.children.size()); for (int i = 1; i < this.children.size(); i++) {// Skip the first one, since it's also the base newChildren.addElement(((Expression)children.elementAt(i)).rebuildOn(newBase)); } newLocalBase.setSelectIfOrderedBy(getBaseExpression().selectIfOrderedBy()); FunctionExpression rebuilt = (FunctionExpression) newLocalBase.performOperator(getOperator(), newChildren); rebuilt.setResultType(this.getResultType()); //copy over result type. return rebuilt; }
/** * INTERNAL: * Return if the represents an object comparison. */ protected boolean isObjectComparison() { if (this.children.size() != 1) { return false; } int selector = getOperator().getSelector(); if ((selector != ExpressionOperator.IsNull) && (selector != ExpressionOperator.NotNull)) { return false; } Expression base = getBaseExpression(); return (base.isObjectExpression() && (!((ObjectExpression)base).isAttribute())); }
/** * INTERNAL: * Return the ordering query keys. * Used for Workbench integration. */ public List<Expression> getOrderByQueryKeyExpressions() { List<Expression> expressions = new ArrayList<Expression> (); if ((getSelectionQuery() != null) && getSelectionQuery().isReadAllQuery()) { for (Expression orderExpression : ((ReadAllQuery)getSelectionQuery()).getOrderByExpressions()) { if (orderExpression.isFunctionExpression() && ((FunctionExpression)orderExpression).getBaseExpression().isQueryKeyExpression()) { expressions.add(orderExpression); } } } return expressions; }
/** * INTERNAL: * Return the ordering query keys. * Used for Workbench integration. */ public List<Expression> getOrderByQueryKeyExpressions() { List<Expression> expressions = new ArrayList<Expression> (); if ((getSelectionQuery() != null) && getSelectionQuery().isReadAllQuery()) { for (Expression orderExpression : ((ReadAllQuery)getSelectionQuery()).getOrderByExpressions()) { if (orderExpression.isFunctionExpression() && ((FunctionExpression)orderExpression).getBaseExpression().isQueryKeyExpression()) { expressions.add(orderExpression); } } } return expressions; }
/** * When distinct is used with order by the ordered fields must be in the select clause. */ protected void addOrderByExpressionToSelectForDistinct() { for (Expression orderExpression : getOrderByExpressions()) { Expression fieldExpression = orderExpression; while (fieldExpression.isFunctionExpression() && (fieldExpression.getOperator().isOrderOperator())) { fieldExpression = ((FunctionExpression)fieldExpression).getBaseExpression(); } // Changed to call a method to loop through the fields vector and check each element // individually. Jon D. May 4, 2000 for pr 7811 if ((fieldExpression.selectIfOrderedBy()) && !fieldsContainField(getFields(), fieldExpression)) { addField(fieldExpression); } } }