I tried your suggestion, BUT the actual BLOB content is not being SAVED in the database. however, the other fields in my USER_IMAGE table are being writed to the database.
Here's what I'm doing:
1. Populate entity bean
Code:
FormFile imageFile = (FormFile) images[x];
userImageCbo.setUsers(userCbo);
userImageCbo.setUserDefaultFlag(defaultFlag);
userImageCbo.setUserImagePath(destinationPath);
userImageCbo.setImageDataContents( Hibernate.createBlob(imageFile.getFileData() ) );
2. Invoke my Hibernate DAO
Code:
userImagesDao.save(userImageCbo);
3. Spring-Hibernate DAO
Code:
public void save(UserImagesCbo userImagesCbo) {
try {
this.getHibernateTemplate().save(userImagesCbo);
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
The database is not throwing an error, but this is the contents of my blob field in MySQL:
Code:
[BLOB - NULL]
what I'm I doing wrong??? Please help