hibernate个人总结之XML 配置文件
来源:互联网 发布:淘宝卖家等级怎么区分 编辑:程序博客网 时间:2024/05/16 10:23
hibernate.cfg.xml主要在此文件中配置数据库连接的所需要的参数,和pojo的映射文件的路径。
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<!-- 配置数据库驱动 -->
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<!-- 配置数据库URL -->
<property name="hibernate.connection.url">jdbc:oracle:thin:@172.16.11.98:1521:orcl</property>
<!-- 配置数据库用户名 -->
<property name="hibernate.connection.username">teacher</property>
<!-- 配置数据库密码 -->
<property name="hibernate.connection.password">teacher</property>
<!-- 配置数据库方言 -->
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<!-- 是否显示sql语句 -->
<property name="hibernate.show_sql">true</property>
<!-- 是否格式化sql语句 -->
<property name="hibernate.format_sql">true</property>
<!-- Hibernate中缓存的统计策略 http://blog.163.com/qqabc20082006@126/blog/static/2292852520091120112719561/-->
<property name="hibernate.generate_statistics">true</property>
<!-- 默认情况下是auto的,就是说如果不设置的话它是会自动去你的classpath下面找一个bean-validation**包,但是找不到,所以beanvalitionFactory错误 -->
<property name="javax.persistence.validation.mode">none</property>
<!-- 使用hibernate的注解功能 -->
<property name="configurationClass">org.hibernate.cfg.AnnotationConfiguration</property>
<!-- 一对一 多对多 一对多 加载的时候抓取的深度 -->
<property name="hibernate.max_fetch_depth">3</property>
<mapping resource="com/iflysse/hiber/domain/ForumGroup.hbm.xml"/>
<mapping resource="com/iflysse/hiber/domain/ForumUsers.hbm.xml"/>
<mapping resource="com/iflysse/hiber/domain/ForumUserAcc.hbm.xml"/>
<mapping resource="com/iflysse/hiber/domain/ForumRoles.hbm.xml"/>
</session-factory>
</hibernate-configuration>
- hibernate个人总结之XML 配置文件
- hibernate 配置文件之hibernate.cfg.xml说明
- hibernate 配置文件之hibernate.cfg.xml说明
- Hibernate配置文件之hibernate.cfg.xml
- Hibernate学习之配置文件hibernate.cfg.xml
- Hibernate总结(一)--之hibernate配置文件
- hibernate中的配置文件hibernate.cfg.xml的详解总结
- hibernate.cfg.xml 配置文件
- hibernate.cfg.xml配置文件
- hibernate.cfg.xml配置文件
- hibernate.cfg.xml配置文件
- Hibernate.cfg.xml配置文件
- Hibernate.cfg.xml配置文件
- hibernate.cfg.xml配置文件
- Hibernate xml配置文件详解
- hibernate.cfg.xml 配置文件
- hibernate-入门xml配置文件
- hibernate配置文件hibernate.cfg.xml
- 论坛换空间样式变了,布局错位
- 合并两个有序单链表
- Java反射得到属性的值和设置属性的值
- windows XP系统自动关机
- C/C++使用Lu脚本协程
- hibernate个人总结之XML 配置文件
- 分享面试资料包
- SVN 安装基本教程
- RSA加密算法
- Sublime Text 2 的 配置总结
- Linux DMA详解
- c语言宏定义,可变参数的使用
- 64位CentOS release 5.5下cacti监控LVS
- FFMPEG视音频编解码零基础学习方法