---
title: "spring 3.0+hibernate 3.x 升级到spring 3.2+hibernate 4.x"
author: "bluebreath"
date: "2013-03-13T20:57:25Z"
tags: ["Spring"]
categories: ["开源软件"]
slug: "spring-3-0-hibernate-3-x-spring-3-2-hibernate-4-x"
draft: false
lastmod: "2013-03-13T21:06:09Z"
id: 1828949
url: "https://breath.iteye.com/blog/1828949"
---

1.sessionFactory 改为 2.transaction 改为 3.spring 3.2去掉了hibernateTemplate 4.对lob字段的支持，spring3.2去掉了对lobHandler，hibernate 4提供了对lob字段的支持 使用hbm.xml： 将type由org.springframework.orm.hibernate3.support.ClobStringType和org.springframework.orm.hibernate3.support.BlobByteArrayTypes 改为 hibernate 4自带的新类型org.hibernate.type.MaterializedClobType 和 org.hibernate.type.MaterializedBlobType 使用注解：@Lob 参考文档：https://access.redhat.com/knowledge/docs/en-US/JBoss\_Enterprise\_Application\_Platform/6/html/Migration\_Guide/Migrate\_Your\_Hibernate\_33x\_Application\_to\_Hibernate\_4x.html