<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"[url]http://hibernate.sourceforge.net/hibernate-configuration-2.0.[/url]
dtd">
<hibernate-configuration>
<!—- SessionFactory 配置 -->
<session-factory>
<!—- 数据库URL -->
<property name="hibernate.connection.url">
jdbc:mysql://localhost/airline
</property>
<!—- 数据库JDBC驱动 -->
<property name="hibernate.connection.driver_class">
org.gjt.mm.mysql.Driver
</property>
<!—- 数据库用户名 -->
<property name="hibernate.connection.username">
root
</property>
<!—- 数据库用户密码 -->
<property name="hibernate.connection.password">
1234
</property>
<!--dialect ,每个数据库都有其对应的Dialet以匹配其平台特性 -->
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<!—- 是否将运行期生成的SQL输出到日志以供调试 -->
<property name="hibernate.show_sql">
True
</property>
<!—- 是否使用数据库外连接 -->
<property name="hibernate.use_outer_join">
True
</property>
<!—- 事务管理类型,这里我们使用JDBC Transaction -->
<property name="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
<!—映射文件配置,注意配置文件名必须包含其相对于根的全路径 -->
<mapping resource="sample/hibernate/Person.hbm.xml"/>
<mapping resource="sample/hibernate/Flight.hbm.xml"/>
<mapping resource="sample/hibernate/Reservation.hbm.xml"/>
<mapping resource="sample/hibernate/ReservationPK.hbm.xml"/>
</session-factory>
</hibernate-configuration>