开发者

Question about Clob object in Hibernate

开发者 https://www.devze.com 2023-03-18 07:39 出处:网络
In the previous versions of Hibernate, it had the static api Hibernate.createClob(String), which allowed to create开发者_开发技巧 Clob object from String.

In the previous versions of Hibernate, it had the static api Hibernate.createClob(String), which allowed to create开发者_开发技巧 Clob object from String.

Now that this is deprecated, what is the proper way to store String as Clob in Hibernate?

I am having trouble figuring out how the Persistence Object (POJO) will look like.

Thank you.


JPA @Lob annotation:

@Lob
public String getFullText() { return fullText; }

See http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html/entity.html for more info.


I had created a blog about how to read an Oracle XMLType into Hibernate. A Clob will also need a similar approach. I had written the details at

http://rationalspring.wordpress.com

0

精彩评论

暂无评论...
验证码 换一张
取 消