<?xml version="1.0" encoding="GBK"?> <!-- 指定Hibernate配置文件的DTD信息 --> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <!-- hibernate- configuration是連接配置文件的根元素 --> <hibernate-configuration> <session-factory> ...... <!-- 根據(jù)需要自動創(chuàng)建數(shù)據(jù)庫:如果創(chuàng)建表,這里必須為create --> <property name="hbm2ddl.auto">create</property> <!-- 顯示Hibernate持久化操作所生成的 SQL --> <property name="show_sql">true</property> <!-- 將SQL腳本進行格式化后再輸出 --> <property name="hibernate.format_sql">true</property> <!-- 羅列所有的映射文件 --> <mapping resource="....../lovejk.hbm.xml"/> </session-factory> lt;/hibernate-configuration> |