
hibernate
jqncc
一般般帅
展开
-
使用hql或条件查询解决一对多关联查询的N+1查询问题
如下两个实体类有一对多和多对一的双从关联public class DictType{ @Id private int id; private String className; private String classDesc; @Column(name="isSys") private boolean sysParam; @OneToMany(cascade=CascadeT原创 2014-01-06 10:36:37 · 4852 阅读 · 0 评论 -
NHibernateHelper
session-per-request模式,意思是一个请求使用一个session。网上的多数实现是在请求来时开启一个session,请求结束后关闭,利用的是asp.netApplication_BeginRequest,Application_EndRequest两个事件,要保证两个事件操作的是同一个session,需要把session绑定到web上下文。原创 2014-01-14 17:34:19 · 2184 阅读 · 0 评论 -
BatchedTooManyRowsAffectedException Batch update returned unexpected row count异常问题
rewriteBatchedStatementsShould the driver use multiqueries (irregardless of the setting of "allowMultiQueries") as well as rewriting of prepared statements for INSERT into multi-value inserts when原创 2014-10-29 16:13:30 · 4591 阅读 · 0 评论