Skip to content

Commit

Permalink
[#31] Always specify all SQL values for Blob type, even NULL ones (fa…
Browse files Browse the repository at this point in the history
…ils on MySQL)
  • Loading branch information
guillaumebort committed Oct 20, 2010
1 parent 44280bd commit 1cd3822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/src/play/db/jpa/Blob.java
Expand Up @@ -97,7 +97,11 @@ public Object nullSafeGet(ResultSet rs, String[] names, Object o) throws Hiberna
}

public void nullSafeSet(PreparedStatement ps, Object o, int i) throws HibernateException, SQLException {
if(o != null) ps.setString(i, ((Blob)o).UUID + "|" + ((Blob)o).type);
if(o != null) {
ps.setString(i, ((Blob)o).UUID + "|" + ((Blob)o).type);
} else {
ps.setNull(i, Types.VARCHAR);
}
}

public Object deepCopy(Object o) throws HibernateException {
Expand Down

0 comments on commit 1cd3822

Please sign in to comment.