Java LocalSessionFactoryBean从Hibernate 3迁移到4.3中的配置类属性
在迁移到Hibernate 4.3时,我遇到了一个关于bean注入中配置类利用率的小问题 我注入的配置类重写org.hibernate.cfg.configuration类中的某些方法,如validateSchema() 在Hibernate 3中,我的配置文件中有这个选项,它之所以有效是因为configurationClass的get/set方法存在:Java LocalSessionFactoryBean从Hibernate 3迁移到4.3中的配置类属性,java,spring,hibernate,Java,Spring,Hibernate,在迁移到Hibernate 4.3时,我遇到了一个关于bean注入中配置类利用率的小问题 我注入的配置类重写org.hibernate.cfg.configuration类中的某些方法,如validateSchema() 在Hibernate 3中,我的配置文件中有这个选项,它之所以有效是因为configurationClass的get/set方法存在: <bean id="SessionFactory" class="org.springframework.orm.hibernate3.
<bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="$[DATA_SOURCE]" />
</property>
<property name="entityInterceptor">
<ref bean="entityInterceptor"/>
</property>
<property name="configurationClass">
<value>com.hibernate.cfg.CustomSchemaValidationConfiguration</value>
</property>
问题是我仍然想要/需要使用que配置类。
我在代码中看到了很多示例,但我想继续使用spring注入方式。可能吗?有什么建议吗?没有更多的配置类,仍然存在的支持正在消失。有一个全新的配置模型,您必须调整您的解决方案以适应它。@M.Deinum您有什么我可以查找的吗?无论是通过bean还是关于新模型的代码?没有更多的配置类,仍然存在的支持正在消失。有一个全新的配置模型,您必须调整您的解决方案以适应它。@M.Deinum您有什么我可以查找的吗?是通过bean还是关于新模型的代码?
Invalid property 'configurationClass' of bean class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]: Bean property 'configurationClass' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?