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;
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.