Hibernate SessionFactory配置实例
2011-09-21 22:58
344 查看
<!-- Hibernate SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="mappingResources"> <list> <value>com/ouou/model/Videos.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.current_session_context_class">thread</prop> <prop key="hibernate.cglib.use_reflection_optimizer">false</prop> <prop key="hibernate.query.substitutions">true 'Y', false 'N'</prop> <!--add ehcache--> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> <prop key="hibernate.cache.use_query_cache">false</prop><!-- 是否使用查询缓存 --> <!-- <prop key="hibernate.cache.provider_configuration_file_resource_path">/ehcache.xml</prop> <prop key="hibernate.show_sql">true</prop> --> <!--<prop key="hibernate.transaction.auto_close_session">true</prop>--> <prop key="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> <!-- Create/update the database tables automatically when the JVM starts up <prop key="hibernate.hbm2ddl.auto">update</prop> --> <!-- Turn batching off for better error messages under PostgreSQL --> <prop key="hibernate.jdbc.batch_size">25</prop> <!-- <prop key="hibernate.connection.pool_size">10</prop> --> </props> </property> </bean>
SOURCE: http://www.blogjava.net/amigoxie/archive/2008/06/30/211757.html
相关文章推荐
- spring事务配置Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplemento
- Hibernate配置文件报错:The content of element type "session-factory" must match "(property*,mapping*,(c
- Hibernate与Spring整合的一些配置问题(一)——LocalSessionFactoryBean
- hibernate4不使用hibernate3的AnnotationSessionFactoryBean配置sessionFactory
- spring配置文件报java.lang.NoClassDefFoundError: org.hibernate.engine.SessionFactory
- 【Hibernate】配置错误The content of element type "session-factory".......
- [Hibernate]hibernate4不使用hibernate3的AnnotationSessionFactoryBean配置sessionFactory
- SSH整合,"sessionFactory " or "hibernateTemplate " is required异常
- Maven搭建Spring MVC4 Hibernate4全注解项目配置实例详解
- Hibernate4.3 buildSessionFactory过时解决方案
- Spring MVC注解配置结合Hibernate的入门教程及其代码实例
- Hibernate实例--XML配置表映射
- Spring3 整合MyBatis3 配置多数据源 动态选择SqlSessionFactory
- Hibernate配置文件(.cfg.xml)参考实例
- sessionFactory' defined in class path /mappingDirectoryLocations配置问题
- spring+hibernate注解配置实例
- 史上最简单的struts+spring+hibernate配置实例[修订版](2005-5-11 周三)_作者:heweiya
- HibernateSessionFactory
- HibernateSessionFactory建立-使用ThreadLocal
- hibernate.properties not found(导致Configured SessionFactory: null 错误)