<?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>
<!-- 配置数据库连接 connection -->
<session-factory>
<!-- 数据库驱动 -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- 数据库地址 localhost可以写作 jdbc:mysql:/// -->
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/database_name</property>
<!-- 数据库用户名 -->
<property name="hibernate.connection.username">username</property>
<!-- 数据库用户的密码 -->
<property name="hibernate.connection.password">password</property>

<!-- 数据库方言 MySQL -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- 连接池 C3P0 -->
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>

<!-- 格式化输出生成的SQL语句 -->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>

     <!-- hibernate根据映射关系自动建表
默认: 不会创建表
create: 没有表就创建,有表就删除重建。
create-drop: 没有表就创建,有表就删除重建,使用完自动删表。
update: 没有表就创建表,否则使用现有的表。
validate: 不会创建表
-->
<property name="hibernate.hbm2ddl.auto">validate</property>

<!-- 加载映射文件 -->
<mapping resource="package.name.ClassName.hbm.xml"