Hibernate 配置文件
来源:互联网 发布:淘宝如何解除实名认证 编辑:程序博客网 时间:2024/06/06 00:21
hibernate.cfg.xml(一般放在src目录下)
<?xml version='1.0' encoding='utf-8'?><!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> <!-- Database connection settings --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql:///test</property> <property name="connection.username">root</property> <property name="connection.password"></property> <!-- SQL dialect (方言)--> <!-- 配置dialect方言,明确告诉hibernate连接是哪种数据库 --> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <!-- Disable the second-level cache --> <!-- <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property> --> <!-- Echo all executed SQL to stdout --> <property name="show_sql">true</property> <!-- Drop and re-create the database schema on startup --> <!-- <property name="hbm2ddl.auto">create</property> --> <span style="white-space:pre"></span><!-- 映射的文件--> <mapping resource="com/haitun/dao/user.hbm.xml"/> </session-factory></hibernate-configuration>user.hbm.xml(放在对应的JavaBean类下)
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><!-- Generated 2015-1-15 12:41:32 by Hibernate Tools 3.4.0.CR1 --><hibernate-mapping> <class name="com.haitun.dao.User" table="_user" catalog="bbs"> <id name="id" type="java.lang.Integer"> <column name="id" /> <generator class="identity" /> </id> <property name="name" type="string"> <column name="name" length="64" not-null="true" /> </property> <property name="password" type="string"> <column name="password" length="128" not-null="true" /> </property> </class></hibernate-mapping>
0 0
- hibernate配置文件
- Hibernate配置文件
- Hibernate配置文件
- Hibernate配置文件
- hibernate配置文件
- Hibernate配置文件
- Hibernate配置文件
- Hibernate配置文件
- Hibernate 配置文件
- hibernate配置文件
- Hibernate配置文件
- Hibernate配置文件
- hibernate配置文件
- hibernate配置文件
- Hibernate配置文件
- hibernate配置文件
- Hibernate配置文件
- hibernate配置文件
- Financial Management
- tar命令
- shell文件操作(删除,显示,查找,增加,替换) sed用法
- 40个迹象表明你还是PHP菜鸟(转载)
- Hadoop添加删除节点
- Hibernate 配置文件
- Android 亮度调节
- 解决Hi-Tcc更新联系人页面crash问题
- Adobe Illustrator 存储fxg格式时报错
- android Eclipse 常用快捷键
- MySQL监控应该知道的九件事
- ios 验证设备类型的宏定义
- oracle:不安装oracle客户端,连接其他服务器,使用pl/sql Developer
- Android实现转盘效果