Permalink
Browse files

Fix saving null

  • Loading branch information...
1 parent e3ebddf commit adf1ca35e210c820807cbec7d08563afbf7affe1 alta189 committed May 13, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/main/java/com/alta189/simplesave/internal/PreparedStatementUtils.java
@@ -23,6 +23,10 @@
public class PreparedStatementUtils {
public static void setObject(PreparedStatement statement, int index, Object o) throws SQLException {
+ if (o == null) {
+ statement.setObject(index, null);
+ return;
+ }
Class clazz = o.getClass();
if (clazz.equals(int.class) || clazz.equals(Integer.class)) {
statement.setInt(index, ((Number) o).intValue());

0 comments on commit adf1ca3

Please sign in to comment.