
SSH
liliyayaer
哈哈哈
展开
-
Spring,Struts整合方式
为了在Struts中加载Spring context,需要在struts-config.xml文件中加入如下部分: <struts-config> <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property pro...原创 2008-08-08 14:29:22 · 108 阅读 · 0 评论 -
Hibernate中的层级查询
1、只有两个层次时候的查询: 方法1-利用HQL查询: public class Pack { private String id; private Pack parentPack; public String getId() { return id; } public void setId(String id) { this.id = id; } public P...2008-08-08 17:44:43 · 384 阅读 · 0 评论 -
Hibernate多表关联查询的结果处理
如果我们在Hibernate中需要查询多个表的不同字段,如何来获取结果呢? 有两种方式: 1、 对各个字段分别转化成对应类型,如下: Query q = session.createQuery(" select members, classInfo.className " + " from Members members, ClassInfo classInfo " + " where m...原创 2008-08-17 13:39:03 · 116 阅读 · 0 评论 -
How to solve the hibernate N+1 problem?
How to solve the hibernate N+1 problem? In hibernate, one-to-one relationship causes the N+1 problem. for example a husband has a wife, and a wife has a husband. it's a typical example...原创 2008-12-05 08:36:59 · 211 阅读 · 0 评论