/** * 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); } }
/** * 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); } }