@Override protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleMath(ExpressionOperator.Concat, "||")); addOperator(ExpressionOperator.simpleFunction(ExpressionOperator.Ceil, "CEILING")); addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Nvl, "NULLIF")); addOperator(toNumberOperator()); addOperator(monthsBetweenOperator()); addOperator(greatest()); addOperator(rightTrim2()); addOperator(leftTrim()); addOperator(rightTrim()); addOperator(ExpressionOperator.simpleFunction(ExpressionOperator.Length, "CHAR_LENGTH")); addOperator(substring()); addOperator(substring2()); }
public FirebirdPlatform() { super(); setPingSQL("SELECT 1 FROM RDB$DATABASE"); }
/** * Print the pagination SQL using FB syntax " ROWS <max> TO <first>". */ @Override public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement) { int max = 0; int firstRow = 0; if (statement.getQuery() != null) { max = statement.getQuery().getMaxRows(); firstRow = statement.getQuery().getFirstResult(); } // Both must be set, otherwise if one is set next, the old cached SQL would be used. if (!shouldUseRownumFiltering() || (max <= 0) || (firstRow <= 0)) { super.printSQLSelectStatement(call, printer, statement); return; } statement.setUseUniqueFieldAliases(true); call.setFields(statement.printSQL(printer)); printer.printString(" ROWS ("); printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD); printer.printString(" + 1) TO "); printer.printParameter(DatabaseCall.MAXROW_FIELD); call.setIgnoreFirstRowMaxResultsSettings(true); }
/** * Print the pagination SQL using FB syntax " ROWS {@literal <max> TO <first>}". */ @Override public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement) { int max = 0; int firstRow = 0; if (statement.getQuery() != null) { max = statement.getQuery().getMaxRows(); firstRow = statement.getQuery().getFirstResult(); } // Both must be set, otherwise if one is set next, the old cached SQL would be used. if (!shouldUseRownumFiltering() || (max <= 0) || (firstRow <= 0)) { super.printSQLSelectStatement(call, printer, statement); return; } statement.setUseUniqueFieldAliases(true); call.setFields(statement.printSQL(printer)); printer.printString(" ROWS ("); printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD); printer.printString(" + 1) TO "); printer.printParameter(DatabaseCall.MAXROW_FIELD); call.setIgnoreFirstRowSetting(true); call.setIgnoreMaxResultsSetting(true); }
@Override protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleMath(ExpressionOperator.Concat, "||")); addOperator(ExpressionOperator.simpleFunction(ExpressionOperator.Ceil, "CEILING")); addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Nvl, "NULLIF")); addOperator(toNumberOperator()); addOperator(monthsBetweenOperator()); addOperator(greatest()); addOperator(rightTrim2()); addOperator(leftTrim()); addOperator(rightTrim()); addOperator(ExpressionOperator.simpleFunction(ExpressionOperator.Length, "CHAR_LENGTH")); addOperator(substring()); addOperator(substring2()); }
public FirebirdPlatform() { super(); setPingSQL("SELECT 1 FROM RDB$DATABASE"); }
/** * Print the pagination SQL using FB syntax " ROWS {@literal <max> TO <first>}". */ @Override public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement) { int max = 0; int firstRow = 0; if (statement.getQuery() != null) { max = statement.getQuery().getMaxRows(); firstRow = statement.getQuery().getFirstResult(); } // Both must be set, otherwise if one is set next, the old cached SQL would be used. if (!shouldUseRownumFiltering() || (max <= 0) || (firstRow <= 0)) { super.printSQLSelectStatement(call, printer, statement); return; } statement.setUseUniqueFieldAliases(true); call.setFields(statement.printSQL(printer)); printer.printString(" ROWS ("); printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD); printer.printString(" + 1) TO "); printer.printParameter(DatabaseCall.MAXROW_FIELD); call.setIgnoreFirstRowSetting(true); call.setIgnoreMaxResultsSetting(true); }
@Override protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleMath(ExpressionOperator.Concat, "||")); addOperator(ExpressionOperator.simpleFunction(ExpressionOperator.Ceil, "CEILING")); addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Nvl, "NULLIF")); addOperator(toNumberOperator()); addOperator(monthsBetweenOperator()); addOperator(greatest()); addOperator(rightTrim2()); addOperator(leftTrim()); addOperator(rightTrim()); addOperator(ExpressionOperator.simpleFunction(ExpressionOperator.Length, "CHAR_LENGTH")); addOperator(substring()); addOperator(substring2()); }
public FirebirdPlatform() { super(); setPingSQL("SELECT 1 FROM RDB$DATABASE"); }