Skip to content

Commit

Permalink
0003954: Roll back the changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
philipmarzullo64 committed May 20, 2019
1 parent 2924cc6 commit f931d2d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@

import javax.sql.DataSource;

import org.jumpmind.db.model.TypeMap;
import org.jumpmind.db.platform.DatabaseInfo;
import org.jumpmind.db.sql.JdbcSqlTemplate;
import org.jumpmind.db.sql.SqlTemplateSettings;
import org.jumpmind.db.sql.SymmetricLobHandler;
import org.springframework.jdbc.core.SqlTypeValue;
import org.springframework.jdbc.core.StatementCreatorUtils;
import org.springframework.jdbc.support.lob.LobHandler;

public class PostgreSqlJdbcSqlTemplate extends JdbcSqlTemplate {

Expand Down Expand Up @@ -80,22 +77,4 @@ public boolean isDataTruncationViolation(Throwable ex) {
}
return dataTruncationViolation;
}

@Override
protected void setBitValue(PreparedStatement ps, int i, Object arg, int argType) throws SQLException {
if(argType == Types.BIT && arg != null && arg instanceof Number) {
Number n = (Number) arg;
if(n.intValue() > 0) {
StatementCreatorUtils.setParameterValue(ps, i, Types.VARCHAR, "1");
} else if(n.intValue() == 0) {
StatementCreatorUtils.setParameterValue(ps, i, Types.VARCHAR, "0");
} else {
StatementCreatorUtils.setParameterValue(ps, i, verifyArgType(arg, argType), arg);
}
} else {
StatementCreatorUtils.setParameterValue(ps, i, verifyArgType(arg, argType), arg);
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,7 @@ public void setValues(PreparedStatement ps, Object[] args, int[] argTypes,
} else if ((argType == Types.DECIMAL || argType == Types.NUMERIC) && arg != null) {
setDecimalValue(ps, i, arg, argType);
} else if (argType == Types.TINYINT) {
setTinyIntValue(ps, i, arg, argType);
} else if (argType == Types.BIT && arg instanceof Number) {
setBitValue(ps, i, arg, argType);
setTinyIntValue(ps, i, arg, argType);
} else {
StatementCreatorUtils.setParameterValue(ps, i, verifyArgType(arg, argType), arg);
}
Expand All @@ -1043,10 +1041,6 @@ protected void setDecimalValue(PreparedStatement ps, int i, Object arg, int argT
}
}

protected void setBitValue(PreparedStatement ps, int i, Object arg, int argType) throws SQLException {
StatementCreatorUtils.setParameterValue(ps, i, verifyArgType(arg, argType), arg);
}

protected void setNanOrNull(PreparedStatement ps, int i, Object arg, int argType) throws SQLException {
StatementCreatorUtils.setParameterValue(ps, i, verifyArgType(arg, argType), null);
}
Expand Down

0 comments on commit f931d2d

Please sign in to comment.