阅读 152

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会自动创建完成


文章分类
后端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐