forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhibernate.cfg.xml
More file actions
40 lines (38 loc) · 1.99 KB
/
Copy pathhibernate.cfg.xml
File metadata and controls
40 lines (38 loc) · 1.99 KB
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
<?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="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- 数据库驱动 -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- 数据库连接信息 -->
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/db_database24</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">111</property>
<!-- 打印SQL语句 -->
<property name="hibernate.show_sql">true</property>
<!-- 不格式化SQL语句 -->
<property name="hibernate.format_sql">false</property>
<!-- 为Session指定一个自定义策略 -->
<property name="hibernate.current_session_context_class">thread</property>
<!-- C3P0 JDBC连接池 -->
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.timeout">120</property>
<property name="hibernate.c3p0.max_statements">100</property>
<property name="hibernate.c3p0.idle_test_period">120</property>
<property name="hibernate.c3p0.acquire_increment">2</property>
<property name="hibernate.c3p0.validate">true</property>
<!-- 映射文件 -->
<mapping resource="com/lyq/model/user/User.hbm.xml"/>
<mapping resource="com/lyq/model/user/Customer.hbm.xml"/>
<mapping resource="com/lyq/model/product/ProductInfo.hbm.xml"/>
<mapping resource="com/lyq/model/product/ProductCategory.hbm.xml"/>
<mapping resource="com/lyq/model/product/UploadFile.hbm.xml"/>
<mapping resource="com/lyq/model/order/Order.hbm.xml"/>
<mapping resource="com/lyq/model/order/OrderItem.hbm.xml"/>
</session-factory>
</hibernate-configuration>