/** * INTERNAL: * Print SQL using the operator. */ public void printSQL(ExpressionSQLPrinter printer) { // If all children are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !this.children.isEmpty()) { boolean allParams = true; for (Iterator iterator = this.children.iterator(); iterator.hasNext(); ) { Expression child = (Expression)iterator.next(); if (!(child.isParameterExpression() || child.isConstantExpression())) { allParams = false; } } if (allParams) { printer.getCall().setUsesBinding(false); } } ExpressionOperator realOperator; realOperator = getPlatformOperator(printer.getPlatform()); realOperator.printCollection(this.children, printer); }
/** * INTERNAL: * Print SQL using the operator. */ @Override public void printSQL(ExpressionSQLPrinter printer) { // If all children are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !this.children.isEmpty()) { boolean allParams = true; for (Iterator<Expression> iterator = this.children.iterator(); iterator.hasNext(); ) { Expression child = iterator.next(); if (!(child.isParameterExpression() || child.isConstantExpression())) { allParams = false; } } if (allParams) { printer.getCall().setUsesBinding(false); } } ExpressionOperator realOperator; realOperator = getPlatformOperator(printer.getPlatform()); realOperator.printCollection(this.children, printer); }
/** * INTERNAL: * Print SQL using the operator. */ public void printSQL(ExpressionSQLPrinter printer) { // If all children are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !this.children.isEmpty()) { boolean allParams = true; for (Iterator iterator = this.children.iterator(); iterator.hasNext(); ) { Expression child = (Expression)iterator.next(); if (!(child.isParameterExpression() || child.isConstantExpression())) { allParams = false; } } if (allParams) { printer.getCall().setUsesBinding(false); } } ExpressionOperator realOperator; realOperator = getPlatformOperator(printer.getPlatform()); realOperator.printCollection(this.children, printer); }
/** * INTERNAL: * Append the constant value into the printer */ public void writeFields(ExpressionSQLPrinter printer, Vector newFields, SQLSelectStatement statement) { if (printer.getPlatform().isDynamicSQLRequiredForFunctions()) { printer.getCall().setUsesBinding(false); } //print ", " before each selected field except the first one if (printer.isFirstElementPrinted()) { printer.printString(", "); } else { printer.setIsFirstElementPrinted(true); } // This field is a constant value, so any name can be used. newFields.addElement(new DatabaseField("*")); printSQL(printer); } }
/** * INTERNAL: * Append the constant value into the printer */ @Override public void writeFields(ExpressionSQLPrinter printer, Vector newFields, SQLSelectStatement statement) { if (printer.getPlatform().isDynamicSQLRequiredForFunctions()) { printer.getCall().setUsesBinding(false); } //print ", " before each selected field except the first one if (printer.isFirstElementPrinted()) { printer.printString(", "); } else { printer.setIsFirstElementPrinted(true); } // This field is a constant value, so any name can be used. newFields.addElement(new DatabaseField("*")); printSQL(printer); } }
/** * INTERNAL: * Append the constant value into the printer */ @Override public void writeFields(ExpressionSQLPrinter printer, Vector newFields, SQLSelectStatement statement) { if (printer.getPlatform().isDynamicSQLRequiredForFunctions()) { printer.getCall().setUsesBinding(false); } //print ", " before each selected field except the first one if (printer.isFirstElementPrinted()) { printer.printString(", "); } else { printer.setIsFirstElementPrinted(true); } // This field is a constant value, so any name can be used. newFields.addElement(new DatabaseField("*")); printSQL(printer); } }
/** * INTERNAL: * Append the parameter into the printer. * "Normal" ReadQuery never has ParameterExpression in it's select clause hence for a "normal" ReadQuery this method is never called. * The reason this method was added is that UpdateAllQuery (in case temporary storage is required) * creates a "helper" ReportQuery with ReportItem corresponding to each update expression - and update expression * may be a ParameterExpression. The call created by "helper" ReportQuery is never executed - * it's used during construction of insert call into temporary storage. */ public void writeFields(ExpressionSQLPrinter printer, Vector newFields, SQLSelectStatement statement) { if (printer.getPlatform().isDynamicSQLRequiredForFunctions()) { printer.getCall().setUsesBinding(false); } //print ", " before each selected field except the first one if (printer.isFirstElementPrinted()) { printer.printString(", "); } else { printer.setIsFirstElementPrinted(true); } // This field is a parameter value, so any name can be used. newFields.addElement(new DatabaseField("*")); printSQL(printer); }
/** * INTERNAL: * Append the parameter into the printer. * "Normal" ReadQuery never has ParameterExpression in it's select clause hence for a "normal" ReadQuery this method is never called. * The reason this method was added is that UpdateAllQuery (in case temporary storage is required) * creates a "helper" ReportQuery with ReportItem corresponding to each update expression - and update expression * may be a ParameterExpression. The call created by "helper" ReportQuery is never executed - * it's used during construction of insert call into temporary storage. */ @Override public void writeFields(ExpressionSQLPrinter printer, Vector newFields, SQLSelectStatement statement) { if (printer.getPlatform().isDynamicSQLRequiredForFunctions()) { printer.getCall().setUsesBinding(false); } //print ", " before each selected field except the first one if (printer.isFirstElementPrinted()) { printer.printString(", "); } else { printer.setIsFirstElementPrinted(true); } // This field is a parameter value, so any name can be used. newFields.addElement(new DatabaseField("*")); printSQL(printer); }
/** * INTERNAL: * Append the parameter into the printer. * "Normal" ReadQuery never has ParameterExpression in it's select clause hence for a "normal" ReadQuery this method is never called. * The reason this method was added is that UpdateAllQuery (in case temporary storage is required) * creates a "helper" ReportQuery with ReportItem corresponding to each update expression - and update expression * may be a ParameterExpression. The call created by "helper" ReportQuery is never executed - * it's used during construction of insert call into temporary storage. */ @Override public void writeFields(ExpressionSQLPrinter printer, Vector newFields, SQLSelectStatement statement) { if (printer.getPlatform().isDynamicSQLRequiredForFunctions()) { printer.getCall().setUsesBinding(false); } //print ", " before each selected field except the first one if (printer.isFirstElementPrinted()) { printer.printString(", "); } else { printer.setIsFirstElementPrinted(true); } // This field is a parameter value, so any name can be used. newFields.addElement(new DatabaseField("*")); printSQL(printer); }
if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false);
if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false);
if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false);
prepare((List<Expression>) items, printer); if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false);
prepare((List<Expression>) items, printer); if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false);
/** * INTERNAL: * Print SQL */ public void printSQL(ExpressionSQLPrinter printer) { // If both sides are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && ((this.firstChild.isParameterExpression() || this.firstChild.isConstantExpression()) && (this.secondChild.isParameterExpression() || this.secondChild.isConstantExpression()))) { printer.getCall().setUsesBinding(false); } if (isEqualNull(printer)) { this.firstChild.isNull().printSQL(printer); } else if (isNotEqualNull(printer)) { this.firstChild.notNull().printSQL(printer); } else { super.printSQL(printer); } }
/** * INTERNAL: * Print SQL */ public void printSQL(ExpressionSQLPrinter printer) { // If both sides are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && ((this.firstChild.isParameterExpression() || this.firstChild.isConstantExpression()) && (this.secondChild.isParameterExpression() || this.secondChild.isConstantExpression()))) { printer.getCall().setUsesBinding(false); } if (isEqualNull(printer)) { this.firstChild.isNull().printSQL(printer); } else if (isNotEqualNull(printer)) { this.firstChild.notNull().printSQL(printer); } else { super.printSQL(printer); } }
/** * INTERNAL: * Print SQL */ public void printSQL(ExpressionSQLPrinter printer) { // If both sides are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && ((this.firstChild.isParameterExpression() || this.firstChild.isConstantExpression()) && (this.secondChild.isParameterExpression() || this.secondChild.isConstantExpression()))) { printer.getCall().setUsesBinding(false); } if (isEqualNull(printer)) { this.firstChild.isNull().printSQL(printer); } else if (isNotEqualNull(printer)) { this.firstChild.notNull().printSQL(printer); } else { super.printSQL(printer); } }
/** * INTERNAL: * For performance, special case printing two children, since it's by far the most common */ public void printDuo(Expression first, Expression second, ExpressionSQLPrinter printer) { // Certain functions don't allow binding on some platforms. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false); } int dbStringIndex; if (isPrefix()) { printer.printString(getDatabaseStrings()[0]); dbStringIndex = 1; } else { dbStringIndex = 0; } first.printSQL(printer); if (dbStringIndex < getDatabaseStrings().length) { printer.printString(getDatabaseStrings()[dbStringIndex++]); } if (second != null) { second.printSQL(printer); if (dbStringIndex < getDatabaseStrings().length) { printer.printString(getDatabaseStrings()[dbStringIndex++]); } } }
/** * INTERNAL: * For performance, special case printing two children, since it's by far the most common */ public void printDuo(Expression first, Expression second, ExpressionSQLPrinter printer) { // Certain functions don't allow binding on some platforms. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false); } int dbStringIndex; if (isPrefix()) { printer.printString(getDatabaseStrings()[0]); dbStringIndex = 1; } else { dbStringIndex = 0; } first.printSQL(printer); if (dbStringIndex < getDatabaseStrings().length) { printer.printString(getDatabaseStrings()[dbStringIndex++]); } if (second != null) { second.printSQL(printer); if (dbStringIndex < getDatabaseStrings().length) { printer.printString(getDatabaseStrings()[dbStringIndex++]); } } }
/** * INTERNAL: * For performance, special case printing two children, since it's by far the most common */ public void printDuo(Expression first, Expression second, ExpressionSQLPrinter printer) { // Certain functions don't allow binding on some platforms. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && !isBindingSupported()) { printer.getCall().setUsesBinding(false); } int dbStringIndex; if (isPrefix()) { printer.printString(getDatabaseStrings()[0]); dbStringIndex = 1; } else { dbStringIndex = 0; } first.printSQL(printer); if (dbStringIndex < getDatabaseStrings().length) { printer.printString(getDatabaseStrings()[dbStringIndex++]); } if (second != null) { second.printSQL(printer); if (dbStringIndex < getDatabaseStrings().length) { printer.printString(getDatabaseStrings()[dbStringIndex++]); } } }