关于Hibernate注解model操作大字段Clob,字段过长(50000以上)

环境

win8x64

JDK1.7

hibernate3.2

oracle10g


数据库:

 CONTEXT  CLOB


model

private Clob context;

@Lob
    @Basic(fetch = FetchType.EAGER)
    @Column(name="CONTEXT", columnDefinition="Clob",nullable=true)
    public Clob getContext() {
        return this.context;
    }

    public void setContext(Clob context) {
        this.context = context;
    }


save方法


Clob c  = Hibernate.createClob(context);

info.setContext(c);                         //对象
int f = base.saveObject(info);     //hibernate的基本操作类

————————————————————————————

报错:

org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:101) -ORA-01460: 转换请求无法实现或不合理

————————————————————————————

试了网上很多办法,IO、BLOB、work各种都不行

————————————————————————————

解决办法:

到oracle10g下面拷贝class12.jar到项目

搞定(艹)

果然粗心不行啊

猜你喜欢

转载自blog.csdn.net/xiaonannew/article/details/48787075
今日推荐