简体   繁体   中英

how to compress text and image files using hibernate?

what mechanisms one can use to compress following ? Since I am using multiple databases I want it to be under the hood like how hibernate handle using Dialects.

 @Lob
 @Type(type = "org.hibernate.type.TextType")
 private String data;

or

@Lob
private byte[] data;

LOB which stands for "Large object file" is not neccesary contains text information, so I think mapping it to String field, even with the help of @Type annotation is not the preferred solution, if your DBMS(es) supports CLOB or similar things.

TL;DR I think the second piece of code is way better LOB mapping.

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