【发布时间】:2015-03-06 09:53:22
【问题描述】:
我有以下 sessionFactory Bean 定义:
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jtaTransactionManager" ref="transactionManager" />
<property name="annotatedClasses">
<list>
<value>com.badmitrii.db.entity.Employee</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<!-- Here is a crowd of props -->
</props>
</property>
</bean>
我认为将我需要的所有属性都放入 spring 配置文件中会很不方便。有没有办法将一堆道具移动到一个单独的资源文件中并应用它来加载 bean?
【问题讨论】:
-
您在寻找this吗?
-
@AldourCheng 是的,完全正确。非常感谢。
标签: java spring hibernate properties configuration