在hibernate.xml配置中 添加
<prop key="hibernate.connection.SetBigStringTryClob">true</prop>
如:
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.use_outer_join">true</prop>
<prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
<prop key="hibernate.connection.pool_size">10</prop>
<prop key="hibernate.jdbc.fetch_size">100</prop>
<prop key="hibernate.connection.SetBigStringTryClob">true</prop>
<prop key="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</prop>
</props>
</property>
在模型映射中对应字段配置成
<property name="svalue" type="text">
<column name="SVALUE" />
</property>
java对应的模型中可以直接用 String svalue,
本文介绍如何在Hibernate中正确配置使用CLOB类型的大字符串字段。通过在hibernate.xml中添加特定属性并调整模型映射,使得能够高效地处理大型文本数据。
6520

被折叠的 条评论
为什么被折叠?



