0

At the moment I have hibernate JPA HSQLDB to auto-create my database tables.

<property name="hibernate.hbm2ddl.auto" value="create-drop" />

How can I tell JPA or Hibernate to save a String as a clob/blob field? Ie a very long String. I could not find any annotation so far. How must I configure this on eg a private String myBigContent?

1 Answer 1

1

Hope this may help :)

  @Column( name = "FILEIMAGE" )
    @Lob(type = LobType.BLOB)
    private byte[] fileimage;
1
  • Just for reference. As written I use HSQLDB, which has a serious Bug which is still not fixed in the 2.3.0-SNAPSHOT release. Using @Lob, it always results in a unsupported internal operation: Session Exception. Therefore I switched to @Column(length = 2147483647) which should do the same as lob. Jun 28, 2013 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.