<!-- hibernate.cfg.xml -->
<?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">
<!-- 这里以mysql数据库为例 -->
<hibernate-configuration><session-factory>
<!-- 必配配置 -->
<!-- 数据库驱动 --><property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">xxxxxx</property>
<property name="hibernate.connection.username">xxxxxx</property>
<property name="hibernate.connection.password">xxxxxx</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- 可选配置 -->
<!-- 将hibernate生成的sql语句打印到控制台 默认是false-->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.connection.isolation">4</property>
<property name="hibernate.current_session_context_class">thread</property>
<!-- 实体映射关系配置文件,后续会更新讲解 -->
<!-- 引入orm元数据 路径书写: 填写src下的路径 --><mapping resource="com/heima/domain/Customer.hbm.xml" />
<mapping resource="com/heima/domain/LinkMan.hbm.xml" />
</session-factory>
</hibernate-configuration>