<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- 数据库连接URL -->
<property name="connection.url">
jdbc:mysql://localhost/testHibernate
</property>
<!-- 数据库连接驱动 -->
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<!-- 数据库用户名 -->
<property name="connection.username">root</property>
<!-- 数据库用户密码 -->
<property name="connection.password">password</property>
<!-- 数据库方言 -->
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<!-- 自动创建表 -->
<property name="hbm2ddl.auto">
create
</property>
<!-- 自动创建表 -->
<property name="show_sql">
true
</property>
<!-- 指定映射文件 -->
<mapping resource="cn/itcast/hibernate/domain/User.hbm.xml"/>
<mapping resource="cn/itcast/hibernate/domain/Department.hbm.xml"/>
<mapping resource="cn/itcast/hibernate/domain/Employee.hbm.xml"/>
<mapping resource="cn/itcast/hibernate/domain/Student.hbm.xml"/>
<mapping resource="cn/itcast/hibernate/domain/Person.hbm.xml"/>
<mapping resource="cn/itcast/hibernate/domain/IdCard.hbm.xml"/>
<mapping resource="cn/itcast/hibernate/domain/Teacher.hbm.xml"/>
</session-factory>
</hibernate-configuration>
hibernate_part2_4
最新推荐文章于 2024-07-12 16:35:20 发布