---------------------------hibernate.cfg头部---------------------------
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/1702shop</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="show_sql">true</property>
----------------------------xxxx.hbm头部----------------------------------
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2017-6-7 12:16:56 by Hibernate Tools 3.5.0.Final -->
---------------------------------创建sessionfactory对象-------------------------
Configuration configuration = new Configuration().configure();
//(2)创建ServiceRegistry对象用于注册Hibernate配置信息
//这是Hibernate4中新增的特性。
//<1>创建构建ServiceRegistry对象的ServiceRegistryBuilder对象
ServiceRegistryBuilder builder = new ServiceReg
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/1702shop</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="show_sql">true</property>
----------------------------xxxx.hbm头部----------------------------------
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2017-6-7 12:16:56 by Hibernate Tools 3.5.0.Final -->
---------------------------------创建sessionfactory对象-------------------------
Configuration configuration = new Configuration().configure();
//(2)创建ServiceRegistry对象用于注册Hibernate配置信息
//这是Hibernate4中新增的特性。
//<1>创建构建ServiceRegistry对象的ServiceRegistryBuilder对象
ServiceRegistryBuilder builder = new ServiceReg