hibernate中对大字段处理(Blob&Clob)

来源:互联网 发布:手机编写c语言 编辑:程序博客网 时间:2024/04/30 06:05

SSH框架整合时,对于Oracle中的大字段处理,在hibernate.cfg.xml多了个SetBigStringTryClob设置,其它没有什么特殊的了

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.cglib.use_reflection_optimizer">true</property>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.password">java</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@XX.XX.X.X:1521:test</property>
        <property name="hibernate.connection.username">java</property>

<!--针对大字段必加的-->
       
<property name="hibernate.connection.SetBigStringTryClob">true</property>
        <property name="hibernate.cache.provider_class">org.hibernate.cache.OSCacheProvider</property>
        <property name="hibernate.show_sql">true</property>
        <property name="hibernate.format_sql">true</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
        <mapping resource="com/study/database/hb/map/File.hbm.xml"/>
    </session-factory>
</hibernate-configuration>

参考:http://blog.csdn.net/nearsun/article/details/623887 

原创粉丝点击