Hibernate 配置文件解析
来源:互联网 发布:java jelly 编辑:程序博客网 时间:2024/06/11 09:22
hibernate-release-4.3.11.Final下载百度云链接密码: bqix
Hibernate主配置文件hibernate.cfg.xml解析
<?xml version='1.0' encoding='utf-8'?><!-- ~ Hibernate, Relational Persistence for Idiomatic Java ~ ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later. ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. --><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <!--配置数据库的驱动程序,Hibernate在连接数据库时,需要用到数据库的驱动程序--> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property> <!--设置数据库的连接url:jdbc:oracle:thin:@localhost:1521:orcl--> <property name="connection.username">muzi</property> <!--连接数据库时用户名--> <property name="connection.password">123456</property> <!--连接数据库时密码--> <property name="connection.pool_size">1</property> <!--数据库连接池的大小--> <property name="dialect">org.hibernate.dialect.OracleDialect</property> <!--hibernate.dialect 指定Hibernate使用的数据库方言,即指定Hibernate连接那种类型的数据库服务器。--> <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property> <property name="show_sql">true</property> <!--是否在后台显示Hibernate用到的SQL语句--> <property name="hbm2ddl.auto">update</property> <mapping resource="hibernate2/student.hbm.xml"/> <!--映射文件位置--> </session-factory></hibernate-configuration>
映射配置文件解析
<?xml version="1.0"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><hibernate-mapping package="hibernate1"> <!-- 指定Java对象和数据库表之间映射 --> <class name="Student" table="t_student"> <!-- 对象属性和数据库表字段进行映射 --> <!--对象中的主键属性 id hibernate中必须配置 --> <id name="id" column="id"> <generator class="sequence" > <!-- hibernate_sequence --> <param name="sequence">seq_student</param> </generator> </id> <property name="name" column="name"/> <property name="age" column="age"/> <!-- 可选属性 type:指定java类型 not-null:属性不能为空 unique:记录必须唯一 length:对属性的长度进行检查 --> </class></hibernate-mapping>
阅读全文
0 0
- Hibernate配置文件解析
- hibernate配置文件详细解析
- Hibernate 配置文件解析
- 【SSH】Hibernate:配置文件解析
- hibernate 配置文件详细解析
- Hibernate 配置文件解析
- Hibernate.cfg.xml配置文件解析
- Hibernate.cfg.xml配置文件模板及解析
- Hibernate.cfg.xml配置文件模板及解析
- Hibernate学习--JPA配置文件persistence.xml解析
- Hibernate配置文件创建及解析,hibernate.cfg.xml----Hibernate_0
- Hibernate断网后不能解析cfg配置文件,连接失败的问题
- hibernate在不联网时不能解析配置文件解决方案
- jbpm核心配置文件jbpm.hibernate.cfg.xml的解析
- hibernate在不联网时不能解析配置文件解决方案
- 学习Hibernate源码——配置文件解析,SessionFactory创建
- hibernate在不联网时不能解析配置文件解决方案
- [Java] Hibernate在不联网时不能解析配置文件解决方案
- image fusion
- Android 开发之漫漫长途 Ⅱ——Activity的显示之Window和View(1)
- Mobilenet_YOLO
- scikit-learn
- 虚拟机ubuntu的串口使用
- Hibernate 配置文件解析
- MyEclipse连接MySQL数据库
- 数据结构实验之图论四:迷宫探索
- 数据结构第十周项目——验证算法(二)
- 微信中定时任务执行时,提示access_token失效(小记)
- 第十五周项目1 验证算法(1)插入排序之直接插入排序
- 十三周 项目1(4)
- 点阵LED扫描法介绍
- Windows 下安装 nvm 管理 nodejs 版本