什么是不推荐使用的Hibernate.createClob(Reader reader,int length) [英] What is the alternate for deprecated Hibernate.createClob(Reader reader, int length)

查看:80
本文介绍了什么是不推荐使用的Hibernate.createClob(Reader reader,int length)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来像 Hibernate.createClob(Reader reader,int length)在版本3.6.x中已弃用
它建议使用Use LobHelper.createClob(Reader,long)



LobHelper 是一个接口不是类。



是否存在任何替代的静态方法Hibernate.createClob(Reader reader,int length)

解决方案

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

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


Seems like Hibernate.createClob(Reader reader, int length) is deprecated in version 3.6.x And it suggests to use Use LobHelper.createClob(Reader, long) instead.

But LobHelper is an interface not a class.

Is there any alternate for static method Hibernate.createClob(Reader reader, int length)?

解决方案

I was using the createBlob(bytes[]) from that class. I created a new class and the following method

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

这篇关于什么是不推荐使用的Hibernate.createClob(Reader reader,int length)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆