
Hibernate
文章平均质量分 63
smallnopoint
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hibernate Session.find()方法
查询性能往往是系统性能表现的一个重要方面,查询机制的优劣很大程度上决定了系统的整体性能。这个领域往往也存在最大的性能调整空间。 hibernate2中Session.find()对应于3中的session.createQuery().list();hibernate2中Session.iterate()对应于3中的session.createQuery().iterate();find和...原创 2010-07-27 16:40:08 · 546 阅读 · 0 评论 -
hibernate的缓存使用
1. 关于hibernate缓存的问题:1.1.1. 基本的缓存原理Hibernate缓存分为二级,第一级存放于session中称为一级缓存,默认带有且不能卸载。 第二级是由sessionFactory控制的进程级缓存。是全局共享的缓存,凡是会调用二级缓存的查询方法 都会从中受益。只有经正确的配置后二级缓存才会发挥作用。同时在进行条件查询时必须使用相应的方法才能从缓...原创 2010-07-28 15:51:18 · 88 阅读 · 0 评论 -
org.hibernate.LazyInitializationException: failed to lazily initialize a collect
hibernate manytomany public class Tag implements Serializable { private ArrayList<Advertisement> advertisements = new ArrayList<Advertisement>(); @ManyToMany(ma...原创 2012-04-13 20:16:22 · 276 阅读 · 0 评论 -
org.hibernate.QueryException: illegal attempt to dereference collection
我写的hql为:from Department as d where d.employees.name='Tom';运行时出现异常:org.hibernate.QueryException: illegal attempt to dereference collection 是因为:在上面的HQL语句中,Department的关联实体employees是一个集合,而不直接是...原创 2012-04-17 15:09:33 · 178 阅读 · 0 评论