hibernate.cfg.xml
完整的配置. 这个文件可以当成hibernate.properties
的替代。 若两个文件同时存在,它将覆盖前者的属性.
XML配置文件被默认是放在CLASSPATH
的根目录下. 这是一个例子:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<!-- 以/jndi/name绑定到JNDI的SessionFactory实例 -->
<session-factory
name="java:hibernate/SessionFactory">
<!-- 属性 -->
<property name="connection.datasource">java:/comp/env/jdbc/MyDB</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">false</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory
</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<!-- 映射定义文件 -->
<mapping resource="org/hibernate/auction/Item.hbm.xml"/>
<mapping resource="org/hibernate/auction/Bid.hbm.xml"/>
<!-- 缓存设置 -->
<class-cache class="org.hibernate.auction.Item" usage="read-write"/>
<class-cache class="org.hibernate.auction.Bid" usage="read-only"/>
<collection-cache collection="org.hibernate.auction.Item.bids" usage="read-write"/>
</session-factory>
</hibernate-configuration>
分享到:
相关推荐
Hibernate配置文件中配置各种数据库的driver、URL
hibernate配置,详细的讲了hibernate用的配置文件和方法,可以哦
Hibernate配置文件hibernate.cfg.xml中配置信息详解!
逆向生成hibernate配置文件逆向生成hibernate配置文件逆向生成hibernate配置文件逆向生成hibernate配置文件逆向生成hibernate配置文件逆向生成hibernate配置文件
hibernate配置文件 里面提供了连接数据库 数据库使用的方言 是否打印SQL语句 sql语句的格式 以及对象-关系映射文件的地址等
使用反射机制修改加载到内存的Hibernate配置文件,使用该方法可以将数据库的配置信息提取到别的路径下。
struts2+spring+hibernate 配置文件struts2+spring+hibernate 配置文件
hibernate--5.Hibernate配置文件详解
SpringMVC+Spring+hibernate配置
hibernate 配置 C3P0 连接池
如何使用用myeclipse自动生成hibernate配置文件
springboot2.0多数据源集成hibernate配置hibernateDaoSupport, dao层继承hibernateDaoSupport, 不使用jpa方式。
Hibernate配置文件Hibernate配置文件Hibernate配置文件
介绍了hibernate的两种方法,所用myeclipse版本为8.6,数据库为mysql,按步骤即可完成hibernate配置
hibernate所以配置以及简单的介绍
hibernate的配置介绍,在myeclipse中配置hibernate,hibernate已经在myeclipse中了,创建工程,然后在工程中添加hibernate框架,一些设置
JAVA 使用hibernate配置实例,包括普通java工程版本(不是web工程)和maven配置使用hibernate版本。
Hibernate配置详解,详细描述了Hibernate的配置文件,一对一 一对多,多对多的单双向配置详解。
NULL 博文链接:https://hi-beijing.iteye.com/blog/1174299
帮助大家在配置hibernate方面提供支持