[英]sessionFactory configuration in spring with hibernate version 4+
When we use Hibernate 3.x with Spring, we can configure our localSessionFactoryBean
using postProcess
methods: 当我们在Spring中使用Hibernate 3.x时,我们可以使用postProcess
方法配置localSessionFactoryBean
:
postProcessMappings
postProcessConfiguration
But when I use LocalSessionFactoryBean
with Hibernate version 4+ this methods seems have been deleted from LocalSessionFactoryBean
class. 但是当我在Hibernate 4+版本中使用LocalSessionFactoryBean
,该方法似乎已从LocalSessionFactoryBean
类中删除。 Does Spring add some other ability for configuration sessionFactory
like in previous versions? Spring是否像以前的版本一样为配置sessionFactory
添加其他功能?
A lot of things are removed from the previous version in hibernate, many of them are deprecated. 在休眠状态下,许多东西已从以前的版本中删除,其中许多已弃用。 You code requires significant updating to use a new brand. 您的代码需要进行重大更新才能使用新品牌。 LocalSessionFactoryBean
is not an exception. LocalSessionFactoryBean
也不例外。 Use ServiceRegistryBuilder
to provide services required to use newly baked session factory bean. 使用ServiceRegistryBuilder
提供使用新烘焙的会话工厂bean所需的服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.