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"><hibernate-configuration>
<session-factory>
<!-- 配置hibernate的参数 -->

<!-- 配置数据库方言,根据数据库选择 -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<!-- 数据库驱动 -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- 数据库连接url -->
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306//crm_hibernate0120</property>
<!-- 数据库名字和密码 -->
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">675576</property>

<!-- 为了方便调试是否运行hibernate时在让日志中输出sql语句 -->
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<!--
hbm2ddl.auto的4个值,如果不需要设置为none,建议正式环境设置为none
validate 加载hibernate时,验证创建数据库表结构
create 每次加载hibernate,重新创建数据表的结构,这就是导致数据库表数据丢失的原因。
create-drop 加载hibernate时创建,退出时删除表的 结构
update 加载hibernate自动更新数据库结构
none 不执行检查

 
 -->
 <property name="hibernate.hbm2ddl.auto">none</property>

<!--加载hbm.xml的映射文件  -->
<mapping resource="cn/itcast/crm/domain/CstCustomer.hbm.xml"/>

</session-factory>
</hibernate-configuration>
错误显示09:40:35,339 DEBUG IntegratorServiceImpl:46 - Adding Integrator [org.hibernate.cfg.beanvalidation.BeanValidationIntegrator].
09:40:35,348 DEBUG IntegratorServiceImpl:46 - Adding Integrator [org.hibernate.secure.spi.JaccIntegrator].
09:40:35,354 DEBUG IntegratorServiceImpl:46 - Adding Integrator [org.hibernate.cache.internal.CollectionCacheInvalidator].
09:40:35,526  INFO Version:37 - HHH000412: Hibernate Core {5.0.7.Final}
09:40:35,531  INFO Environment:213 - HHH000206: hibernate.properties not found
09:40:35,534  INFO Environment:317 - HHH000021: Bytecode provider name : javassist
09:40:35,579 DEBUG LocalXmlResourceResolver:57 - Interpreting public/system identifier : [-//Hibernate/Hibernate Configuration DTD 3.0//EN] - [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd]
09:40:35,579 DEBUG LocalXmlResourceResolver:85 - Recognized hibernate-configuration identifier; attempting to resolve on classpath under org/hibernate/
09:40:35,586 DEBUG JaxbCfgProcessor:116 - cfg.xml document did not define namespaces; wrapping in custom event reader to introduce namespace information
09:40:35,801 DEBUG Configuration:722 - Building session factory using internal StandardServiceRegistryBuilder
09:40:35,809 DEBUG ServiceBinding:68 - Overriding existing service binding [org.hibernate.secure.spi.JaccService]
09:40:35,810 DEBUG Configuration:653 - Building session factory using provided StandardServiceRegistry