简体   繁体   中英

Hibernate: Merge BLOB - workaround

I read that Hibernate doesn't allow Merge function on blob attributes.

May I know is there a work around beside using .save ?

I'm assuming you are using 3.x branch because in version 4.x this problem has been resolved.
You have to replace blob manually after merge, than save

Object merged = session.merge(original);
merged.setBlob(session.getLobHelper().createBlob(<use new data>));
session.save(merged);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM