Persisting Serializable Objects in Hibernate

Posted by VeeArr on Stack Overflow See other posts from Stack Overflow or by VeeArr
Published on 2010-06-17T18:39:36Z Indexed on 2010/06/17 18:43 UTC
Read the original article Hit count: 110

Filed under:
|
|
|

I am attempting to persist objects that contain some large Serializable types. I want Hibernate to automatically generate my DDL (using Hibernate annotations). For the most part, this works, but the default database column type used by Hibernate when persisting these types is tinyblob. Unfortunately, this causes crashes when attempting to persist my class, because these types will not fit within the length of tinyblob.

However, if I manually set the type (using @Column(columnDefinition="longblob")), it works fine. Is there any way to make the default binary type longblob instead of tinyblob, so that I don't need to manually specify the @Column annotation on each field?

© Stack Overflow or respective owner

Related posts about java

Related posts about sql