hibernate的实体类是注解配置的,整合spring后 要怎么在spring里写
1个回答
展开全部
希望对你有帮助..
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="hibernateProperties">
<props>...</props>
</property>
<property name="packagesToScan">
<list>
<value>实体类的包</value>
</list>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="hibernateProperties">
<props>...</props>
</property>
<property name="packagesToScan">
<list>
<value>实体类的包</value>
</list>
</property>
</bean>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询