/** * Return the expression builder which is the ultimate base of this expression, or * null if there isn't one (shouldn't happen if we start from a root) */ public ExpressionBuilder getBuilder() { return getLocalBase().getBuilder(); }
/** * 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){ getLocalBase().resetPlaceHolderBuilder(queryBuilder); }
/** * 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 result = (ConstantExpression)clone(); result.setLocalBase(getLocalBase().rebuildOn(newBase)); return result; }
/** * 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 result = (ConstantExpression)clone(); result.setLocalBase(getLocalBase().rebuildOn(newBase)); return result; }
/** * INTERNAL: * Print SQL onto the stream, using the ExpressionPrinter for context */ public void printSQL(ExpressionSQLPrinter printer) { Object value = getLocalBase().getFieldValue(getValue(), getSession()); if(value == null) { printer.printNull(this); } else { printer.printPrimitive(value); } }
/** * INTERNAL: * Print SQL onto the stream, using the ExpressionPrinter for context */ public void printSQL(ExpressionSQLPrinter printer) { Object value = getLocalBase().getFieldValue(getValue(), getSession()); if(value == null) { printer.printNull(this); } else { printer.printPrimitive(value); } }
public void printNull(ConstantExpression nullValueExpression) { if(session.getPlatform().shouldBindLiterals()) { DatabaseField field = null; Expression localBase = nullValueExpression.getLocalBase(); if(localBase != null && (localBase.isFieldExpression() || localBase.isQueryKeyExpression())) { field = ((DataExpression)localBase).getField(); } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), field); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), null); } }
public void printNull(ConstantExpression nullValueExpression) { if(session.getPlatform().shouldBindLiterals()) { DatabaseField field = null; Expression localBase = nullValueExpression.getLocalBase(); if(localBase.isFieldExpression()) { field = ((FieldExpression)localBase).getField(); } else if(localBase.isQueryKeyExpression()) { field = ((QueryKeyExpression)localBase).getField(); } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), field); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), null); } }
public void printNull(ConstantExpression nullValueExpression) { if(session.getPlatform().shouldBindLiterals()) { DatabaseField field = null; Expression localBase = nullValueExpression.getLocalBase(); if(localBase.isFieldExpression()) { field = ((FieldExpression)localBase).getField(); } else if(localBase.isQueryKeyExpression()) { field = ((QueryKeyExpression)localBase).getField(); } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), field); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), null); } }
} else if (expression.isConstantExpression()) { value = ((ConstantExpression)expression).getValue(); if (((ConstantExpression)expression).getLocalBase() != null) { value = ((ConstantExpression)expression).getLocalBase().getFieldValue(value, query.getSession());