hibernate
花间一壶酒..
这个作者很懒,什么都没留下…
展开
-
hibernate优化
hibernate优化 Robbin总结的Hibernate性能优化要点: 1.尽量使用many-to-one,避免使用单项one-to-many 2.灵活使用单向one-to-many 3.不用一对一,使用多对一代替一对一 4.配置对象缓存,不使用集合缓存 5.一对多使用Bag 多对一使用Set 6.继承使用显示多态 HQL:from object转载 2015-06-26 00:05:29 · 265 阅读 · 0 评论 -
Hibernate POJO为什么要实现Serializable接口
无意当中想到这个问题,然后google 一下。找到一篇对 serialization 介绍的文章,关于这个问题比较多的人解释是:hibernate有二级缓存,缓存会将对象写进硬盘,就必须序列化,以及兼容对象在网络中的传输 等等...? 目的:将二级缓存中的内容持久化保存下来,便于恢复缓存的信息,hibernate的缓存机制通过使用序列化,断定应该是基于序列化的缓存,如没有serializab转载 2015-07-01 11:13:45 · 330 阅读 · 0 评论 -
hibernate优缺点
Hibernate的优缺点: 优点:1、程序更加面向对象; 2、提高了生产率; 3、方便移植(修改配置文件); 4、无侵入性。 缺点: 1、效率比JDBC略差; 2、不适合批量操作。 Hibernate有四种查询方案: 1、get,load方法,根据id查找对象转载 2015-07-08 22:29:57 · 495 阅读 · 0 评论 -
Hibernate中的一级缓存
Hibernate中的一级缓存 HibernateTest.java 代码: 1 /** 2 * 3 */ 4 package com.b510.examplex; 5 6 import org.hibernate.Session; 7 8 9 /** 10 * 11 * @author XHW 12 * 13 *转载 2015-07-01 09:26:39 · 264 阅读 · 0 评论 -
hibernate.hbm2ddl.auto配置详解
hibernate.cfg.xml 中hibernate.hbm2ddl.auto配置节点如下: Hibernate Reference Documentation 3.3.1解释如下: Automatically validate or export schema DDL to the database when the SessionFactory is create转载 2015-07-02 21:26:47 · 247 阅读 · 0 评论