mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 01:46:18 +08:00
Use Hibernate framework to operate pojo instance, bye bye SQL strings :)
This commit is contained in:
45
src/main/resources/hibernate.cfg.xml
Normal file
45
src/main/resources/hibernate.cfg.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!--
|
||||
~ Hibernate, Relational Persistence for Idiomatic Java
|
||||
~
|
||||
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
-->
|
||||
<!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>
|
||||
|
||||
<!-- Database connection settings -->
|
||||
<!--<property name="jndi.class">org.apache.naming.factory.BeanFactory</property>-->
|
||||
<property name="connection.datasource">java:comp/env/jdbc/netsupport</property>
|
||||
<!--<property name="connection.driver_class">com.mysql.jdbc.Driver</property>-->
|
||||
<!--<property name="connection.url">jdbc:mysql://localhost:3306/***?autoReconnect=true&characterEncoding=utf8</property>-->
|
||||
<!--<property name="connection.username">***</property>-->
|
||||
<!--<property name="connection.password">***</property>-->
|
||||
|
||||
<!-- JDBC connection pool (use the built-in) -->
|
||||
<!--<property name="connection.pool_size">50</property>-->
|
||||
|
||||
<!-- SQL dialect -->
|
||||
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
|
||||
|
||||
<!-- Disable the second-level cache -->
|
||||
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
|
||||
|
||||
<!-- Echo all executed SQL to stdout -->
|
||||
<property name="show_sql">true</property>
|
||||
|
||||
<!-- Drop and re-create the database schema on startup -->
|
||||
<property name="hbm2ddl.auto">validate</property>
|
||||
|
||||
<!-- Names the annotated entity class -->
|
||||
<mapping class="love.sola.netsupport.pojo.User"/>
|
||||
<mapping class="love.sola.netsupport.pojo.Ticket"/>
|
||||
|
||||
</session-factory>
|
||||
|
||||
</hibernate-configuration>
|
||||
Reference in New Issue
Block a user