hibernate操作oracle clob字段

数据库驱动为10g的驱动,就可以像操作STRING一样操作CLOB了
HIBERNATE配置加一行:
<property name="hibernate.connection.SetBigStringTryClob">true</property>
HIBERNATE映射CLOB字段写为:
<property name="content" type="text">
<column name="CONTENT" />
</property>
持久化类属性为STRING
<bean id="hibernateProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="hibernate.dialect">
${hibernate.dialect}
</prop>
<prop key="hibernate.transaction.factory_class">
${hibernate.transaction.factory_class}
</prop>
<prop key="hibernate.query.factory_class">
${hibernate.query.factory_class}
</prop>
<prop key="hibernate.jdbc.fetch_size">
${hibernate.jdbc.fetch_size}
</prop>
<prop key="hibernate.jdbc.batch_size">
${hibernate.jdbc.batch_size}
</prop>
<prop key="hibernate.connection.pool_size">
${hibernate.connection.pool_size}
</prop>
<prop key="hibernate.statement_cache.size">
${hibernate.statement_cache.size}
</prop>
<prop key="hibernate.maxActive">
${hibernate.maxActive}
</prop>
<prop key="hibernate.maxIdle">
${hibernate.maxIdle}
</prop>
<prop key="hibernate.show_sql">
${hibernate.show_sql}
</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop key="hibernate.connection.SetBigStringTryClob">true</prop>
</props>
</property>
</bean>

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class dynamic-insert="true" dynamic-update="true" lazy="false"
name="com.bb2c.product.model.ProductDetail" table="TB_PRODUCT_DETAIL">
<id name="prodId" column="PROD_ID" unsaved-value="null">
<generator class="assigned" />
</id>
<property name="prodDesc" column="PROD_DESC" type="text"></property>
</class>
</hibernate-mapping>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值