hibernate配置文件
hibernate的配置文件在hibernate.cfg.xml文件中编写
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.url">jdbc:mysql://localhost:3306/studyhibernate</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.username">root</property> <property name="connection.password">123456</property>
<property name="connection.pool_size">1</property> <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property> <property name="show_sql">true</property> <property name="format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property> <property name="current_session_context_class">thread</property>
<property name="cache.use_second_level_cache">false</property>
<mapping resource="User.hbm.xml"/> <mapping resource="Customer.hbm.xml"/> <mapping resource="Order.hbm.xml"/> <mapping resource="Department.hbm.xml"/> <mapping resource="Manager.hbm.xml"/>
</session-factory> </hibernate-configuration>
|