hibernate - 不推荐使用的 Hibernate.createClob(Reader reader, int length) 的替代方法是什么

标签 hibernate deprecated clob

好像是 Hibernate.createClob(Reader reader, int length)在 3.6.x 版本中已弃用
它建议使用使用 LobHelper.createClob(Reader, long)反而。

但是LobHelper是一个接口(interface)而不是一个类。
static method Hibernate.createClob(Reader reader, int length) 有替代品吗? ?

最佳答案

我正在使用该类的 createBlob(bytes[]) 。我创建了一个新类和以下方法

    public static Blob createBlob(byte[] bytes) {
       return NonContextualLobCreator.INSTANCE.wrap(NonContextualLobCreator.INSTANCE.createBlob(bytes));
    }

关于hibernate - 不推荐使用的 Hibernate.createClob(Reader reader, int length) 的替代方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9304211/

相关文章:

java - 如何在 Hibernate 中使用@Subselect

java - 弃用的编译错误

database - Oracle NCLOB 问题

sql - Oracle 中 listagg 的替代方案?

java - Apache Beam TextIO glob 获取原始文件名

java 。如何通过反射获取不可为空的字段?

java - 由于此结果集已关闭而无法打开连接

vb.net - Oracle.Connection 的替代品是什么?

java - Hibernate @ManyToMany 单向关系

android - 在向后兼容的代码中有这么多不推荐使用的方法可以吗?