Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to fetch a BLOB LAZY using Hibernate

i try to find the best way to fetch a blob:

  • I found javassit instrumentation

  • Or implementing FieldHandled

  • Use "fake" one-to-one mappings instead of properties. Remove the LOB fields from your existig class, create new classes referring to the same table, same primary key, and only the necessary LOB fields as properties. Specify the mappings as one-to-one, fetch="select", lazy="true". So long as your parent object is still in your session, you should get exactly what you want.

Is there any other solution. What is the best aproach?

like image 629
brianbro Avatar asked Nov 05 '22 05:11

brianbro


1 Answers

Why not use the standard @Lob annotation, here is docs. Its standard and portable

like image 59
anergy Avatar answered Nov 07 '22 20:11

anergy