标签:.net iter ble class .com 抓取 span rip criteria
1.detached在抓取策略为 jion显式左外连接查询情况下 会产生笛卡儿积现象
DetachedCriteria dc = DetachedCriteria.forClass(Topic.class); dc.add(Restrictions.like("title", "%%")); Criteria criteria = dc.getExecutableCriteria(session); criteria.setFirstResult((currentpage - 1) * pagesize); criteria.setMaxResults(pagesize); List<Topic> list = criteria.list();
以上查询在join下产生的结果为
出现了笛卡儿积现象,所以在使用分离查询 分页的时候如果lazy为false 应尽量使用subselect或select抓取策略
hibernate detached分离查询 与 抓取策略注意事项
标签:.net iter ble class .com 抓取 span rip criteria
原文地址:http://www.cnblogs.com/ssjifm/p/7532094.html