IDEA整合hibernate實例

IDEA自動配置hibernate

我的xml配置文件:

<?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.driver_class">com.mysql.jdbc.Driver</property>
    <property name="connection.url">jdbc:mysql://localhost:3306/xiaonei</property>
    <property name="dialect">
      org.hibernate.dialect.MySQLDialect
    </property>
    <property name="connection.profile">
      hspmysql
    </property>
    <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
    <property name="hibernate.connection.pool_size">5</property>
    <property name="hibernate.format_sql">true</property>
    <property name="hibernate.generate_statistics">true</property>
    <property name="hibernate.jdbc.batch_versioned_data">true</property>
    <property name="hibernate.max_fetch_depth">5</property>
    <property name="hibernate.service.allow_crawling">false</property>
    <property name="hibernate.show_sql">true</property>
</session-factory>
</hibernate-configuration>

右擊:

點擊ok等待幾分鐘idea會自動創建完成

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章