• hibernate核心文件配置(位置固定src下面 名称hibernate.cfg.xml)


    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
    <!-- Generated by MyEclipse Hibernate Tools. -->
    <hibernate-configuration>

    <session-factory>
    <property name="dialect">
    org.hibernate.dialect.MySQLDialect
    </property>
    <property name="connection.url">
    jdbc:mysql://localhost:3306/book1
    </property>
    <property name="connection.username">root</property>
    <property name="connection.password">123456</property>
    <property name="connection.driver_class">
    com.mysql.jdbc.Driver
    </property>
    <property name="myeclipse.connection.profile">Test</property>
    <!-- getCurentSsssion的session的上下文 -->
    <property name="current_session_context_class">thread</property>
    <!-- 二级缓存 -->
    <property name="cache.use_second_level_cache">true</property>
    <property name="hibernate.cache.region.factory_class">
    org.hibernate.cache.ehcache.EhCacheRegionFactory
    </property>
    <property name="javax.persistence.validation.mode">none</property>
    <!--查询缓存 -->
    <property name="cache.use_query_cache">true</property>
    <mapping resource="com/yuntu/entity/Booktype.hbm.xml" />
    <mapping resource="com/yuntu/entity/Book.hbm.xml" />

    </session-factory>

    </hibernate-configuration>

  • 相关阅读:
    表示数值的字符串(C++描述)
    单链表是否有环及环入口点
    医院信息运维系统-信息科专用运维系统
    c# List 按类的指定字段排序
    运维系统说明
    更新库下载
    mysql数据库备份
    网络编程基础
    面向对象和过程,一样的价格,不一样的口味
    模块的导入顺序细节
  • 原文地址:https://www.cnblogs.com/dawn-and-night/p/6713733.html
Copyright © 2020-2023  润新知