Problem updating blog with hibernate?
Posted
by johnsmith51
on Stack Overflow
See other posts from Stack Overflow
or by johnsmith51
Published on 2010-03-30T10:01:36Z
Indexed on
2010/03/30
10:03 UTC
Read the original article
Hit count: 322
hi, i am having problem updating a blob with hibernate.
my model have these getters/setters for hibernate, i.e. internally i deal with byte[] so any getter/setter convert the byte[] to blog.
I can create an initial object without problem, but if I try to change the content of the blob, the database column is not updated. I do not get any error message, everything looks fine, except that the database is not updated.
/** do not use, for hibernate only */
public Blob getLogoBinaryBlob() {
if(logoBinary == null){
return null;
}
return Hibernate.createBlob(logoBinary);
}
/** do not use, for hibernate only */
public void setLogoBinaryBlob(Blob logoBinaryBlob) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
logoBinary = toByteArrayImpl(logoBinaryBlob, baos);
} catch (Exception e) {
}
}
© Stack Overflow or respective owner