s2sh整合中hibernate两种配置方式中spring配置文件中的不同
2013-06-23 01:19
591 查看
-0-好像是两处?
spring的配置文件中配置sessionFactory部分
1、xml配置
<!-- 配置sessionFactoty -->
<bean name="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<!-- 配置hibernateproperties -->
<!--忽略-->
<!-- 配置映射资源文件 -->
<property name="mappingResources">
<list>
</list>
</property>
</bean>
2、注释类配置
<!-- 配置sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSoure"></property>
<!-- 配置hibernateproperties -->
<!--忽略-->
<!-- 配置映射资源文件 -->
<property name="annotatedClasses">
<list>
<value>entity.Users</value>
</list>
</property>
</bean>
spring的配置文件中配置sessionFactory部分
1、xml配置
<!-- 配置sessionFactoty -->
<bean name="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<!-- 配置hibernateproperties -->
<!--忽略-->
<!-- 配置映射资源文件 -->
<property name="mappingResources">
<list>
</list>
</property>
</bean>
2、注释类配置
<!-- 配置sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSoure"></property>
<!-- 配置hibernateproperties -->
<!--忽略-->
<!-- 配置映射资源文件 -->
<property name="annotatedClasses">
<list>
<value>entity.Users</value>
</list>
</property>
</bean>
相关文章推荐
- spring+hibernate 两种整合方式配置文件
- spring+hibernate 两种整合方式配置文件
- spring+hibernate 两种整合方式配置文件的方法
- spring 整合hibernate的配置文件的两种方式
- spring+hibernate 两种整合方式配置文件
- spring_day4_09-ssh框架整合其他方式(没有hibernate核心配置文件)
- hibernate和Spring整合时,hibernate映射文件配置方式
- Spring4学习笔记-Spring4整合Struts2(基于配置文件的方式)
- Spring整合Hibernate配置文件
- hibernate中另外两种配置文件方式的配置
- spring 配置国际化资源文件的两种方式(转)
- Spring-boot中读取config配置文件的两种方式
- SSH整合其他方式(没有hibernate的核心配置文件)
- Spring与Hibernate配置文件整合
- 整合hibernate,JBPM.4.4的Spring配置文件
- Spring整合Struts2和Hibernate+Maven(二)之SSH的配置文件
- Spring整合Hibernate配置(使用hibernate.cfg.xml文件)
- Spring+hibernate整合常用的配置文件
- 两种不同连接池不同的加载配置文件方式
- springMVC+hibernate+jdbc+mybatis整合 支持全注解方式 支持全配置方式