/** * Initialize any platform-specific operators */ @Override protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Concat, "CONCAT")); addOperator(operatorOuterJoin()); addOperator(ExpressionOperator.ifNull()); }
/** * Appends an TimesTen specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. * Native Format: 'YYYY-MM-DD HH:MM:SS' */ @Override protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIMESTAMP '"); writer.write(Helper.printCalendarWithoutNanos(calendar)); writer.write("'"); } else { super.appendCalendar(calendar, writer); } }
/** * INTERNAL: * TimesTen and requires cast around parameter markers if both operands of certain * operators are parameter markers * This method generates CAST for parameter markers whose type is correctly * identified by the query compiler. * This is not used by default, only if isCastRequired is set to true, * by default dynamic SQL is used to avoid the issue in only the required cases. */ @Override public void writeParameterMarker(Writer writer, ParameterExpression parameter, AbstractRecord record, DatabaseCall call) throws IOException { String parameterMarker = "?"; Object type = parameter.getType(); if (this.isCastRequired && (type != null)) { FieldTypeDefinition fieldType; fieldType = getFieldTypeDefinition((Class)type); if (fieldType != null){ parameterMarker = "CAST (? AS " + fieldType.getName() + " )"; } } writer.write(parameterMarker); } }
/** * INTERNAL: * TimesTen and requires cast around parameter markers if both operands of certain * operators are parameter markers * This method generates CAST for parameter markers whose type is correctly * identified by the query compiler. * This is not used by default, only if isCastRequired is set to true, * by default dynamic SQL is used to avoid the issue in only the required cases. */ @Override public void writeParameterMarker(Writer writer, ParameterExpression parameter, AbstractRecord record, DatabaseCall call) throws IOException { String parameterMarker = "?"; Object type = parameter.getType(); if (this.isCastRequired && (type != null)) { FieldTypeDefinition fieldType; fieldType = getFieldTypeDefinition((Class)type); if (fieldType != null){ parameterMarker = "CAST (? AS " + fieldType.getName() + " )"; } } writer.write(parameterMarker); } }
/** * Appends an TimesTen specific time if usesNativeSQL is true otherwise use the ODBC format. * Native FORMAT: 'HH:MM:SS'. */ @Override protected void appendTime(java.sql.Time time, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIME '"); writer.write(Helper.printTime(time)); writer.write("'"); } else { super.appendTime(time, writer); } }
/** * Initialize any platform-specific operators */ @Override protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Concat, "CONCAT")); addOperator(operatorOuterJoin()); addOperator(ExpressionOperator.ifNull()); }
/** * INTERNAL: * TimesTen and requires cast around parameter markers if both operands of certain * operators are parameter markers * This method generates CAST for parameter markers whose type is correctly * identified by the query compiler. * This is not used by default, only if isCastRequired is set to true, * by default dynamic SQL is used to avoid the issue in only the required cases. */ @Override public void writeParameterMarker(Writer writer, ParameterExpression parameter, AbstractRecord record, DatabaseCall call) throws IOException { String parameterMarker = "?"; Object type = parameter.getType(); if (this.isCastRequired && (type != null)) { FieldTypeDefinition fieldType; fieldType = getFieldTypeDefinition((Class)type); if (fieldType != null){ parameterMarker = "CAST (? AS " + fieldType.getName() + " )"; } } writer.write(parameterMarker); } }
/** * Appends an TimesTen specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. * Native Format: 'YYYY-MM-DD HH:MM:SS' */ @Override protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIMESTAMP '"); writer.write(Helper.printTimestampWithoutNanos(timestamp)); writer.write("'"); } else { super.appendTimestamp(timestamp, writer); } }
/** * Initialize any platform-specific operators */ @Override protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Concat, "CONCAT")); addOperator(operatorOuterJoin()); addOperator(ExpressionOperator.ifNull()); }
/** * Appends an TimesTen specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. * Native Format: 'YYYY-MM-DD HH:MM:SS' */ @Override protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIMESTAMP '"); writer.write(Helper.printCalendarWithoutNanos(calendar)); writer.write("'"); } else { super.appendCalendar(calendar, writer); } }
/** * Appends an TimesTen specific time if usesNativeSQL is true otherwise use the ODBC format. * Native FORMAT: 'HH:MM:SS'. */ @Override protected void appendTime(java.sql.Time time, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIME '"); writer.write(Helper.printTime(time)); writer.write("'"); } else { super.appendTime(time, writer); } }
/** * Appends an TimesTen specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. * Native Format: 'YYYY-MM-DD HH:MM:SS' */ @Override protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIMESTAMP '"); writer.write(Helper.printTimestampWithoutNanos(timestamp)); writer.write("'"); } else { super.appendTimestamp(timestamp, writer); } }
/** * Appends an TimesTen specific time if usesNativeSQL is true otherwise use the ODBC format. * Native FORMAT: 'HH:MM:SS'. */ @Override protected void appendTime(java.sql.Time time, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIME '"); writer.write(Helper.printTime(time)); writer.write("'"); } else { super.appendTime(time, writer); } }
/** * Appends an TimesTen specific date if usesNativeSQL is true otherwise use the ODBC format. * Native FORMAT: 'YYYY-MM-DD' */ @Override protected void appendDate(java.sql.Date date, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("DATE '"); writer.write(Helper.printDate(date)); writer.write("'"); } else { super.appendDate(date, writer); } }
/** * Appends an TimesTen specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. * Native Format: 'YYYY-MM-DD HH:MM:SS' */ @Override protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIMESTAMP '"); writer.write(Helper.printTimestampWithoutNanos(timestamp)); writer.write("'"); } else { super.appendTimestamp(timestamp, writer); } }
/** * Appends an TimesTen specific date if usesNativeSQL is true otherwise use the ODBC format. * Native FORMAT: 'YYYY-MM-DD' */ @Override protected void appendDate(java.sql.Date date, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("DATE '"); writer.write(Helper.printDate(date)); writer.write("'"); } else { super.appendDate(date, writer); } }
/** * If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format * as provided in DatabasePlatform. */ @Override protected void appendByteArray(byte[] bytes, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("Ox"); Helper.writeHexString(bytes, writer); } else { super.appendByteArray(bytes, writer); } }
/** * Appends an TimesTen specific date if usesNativeSQL is true otherwise use the ODBC format. * Native FORMAT: 'YYYY-MM-DD' */ @Override protected void appendDate(java.sql.Date date, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("DATE '"); writer.write(Helper.printDate(date)); writer.write("'"); } else { super.appendDate(date, writer); } }
/** * Appends an TimesTen specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. * Native Format: 'YYYY-MM-DD HH:MM:SS' */ @Override protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("TIMESTAMP '"); writer.write(Helper.printCalendarWithoutNanos(calendar)); writer.write("'"); } else { super.appendCalendar(calendar, writer); } }
/** * If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format * as provided in DatabasePlatform. */ @Override protected void appendByteArray(byte[] bytes, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("Ox"); Helper.writeHexString(bytes, writer); } else { super.appendByteArray(bytes, writer); } }