配置文件具體內容如下,應該比較好理解。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- 數據源-->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property><property name="connection.url">jdbc:mysql://localhost:3306/hibernatetest</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.pool_size"></property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- ?? -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.anto">create</property>
<!-- 加載相關的映射文件 -->
</session-factory>
</hibernate-configuration>