- 浏览: 502413 次
- 性别:
- 来自: 惠州
文章分类
- 全部博客 (255)
- ant (1)
- springMVC (2)
- ajax (4)
- oracle (12)
- SSH (13)
- struts1 (2)
- Hibernate (14)
- spring (5)
- jstl (1)
- 连接池 (1)
- acegi (4)
- java (17)
- jquery (11)
- div+css (4)
- drupal (1)
- php (8)
- freemaker调模板生成静态页面 (1)
- xml (1)
- json (2)
- javascript (9)
- 正则表达式 (4)
- Ext (8)
- jdbc (1)
- sql server (2)
- perl (5)
- db4o (1)
- webservice (4)
- flex (13)
- it资讯 (1)
- joomla (0)
- 设计模式 (1)
- struts2 (4)
- s2sh (8)
- linux (3)
- ejb (2)
- android旅途 (24)
- android (36)
- C/C++ (16)
- mysql (1)
最新评论
-
fengyuxing168:
IBelyService bs = IBelyService. ...
为 Android 添加 Java 层服务也就是添加自定义的aidl服务到serviceManager 通过ServiceManager.getService取 -
dengzhangtao:
"由于ActivityManagerService是 ...
binder理解 -
yzyspy:
ActivityManagerService:startHom ...
Android的Launcher成为系统中第一个启动的,也是唯一的 -
Matchstick:
使用SELECT DISTINCT alias FROM Po ...
hibernate 一对多表查询时fetchMode.join 生成left outer join 出来数据重复问题 -
dlheart:
没看懂你什么意思啊,我遇到的问题是一对多,设了fetch = ...
hibernate 一对多表查询时fetchMode.join 生成left outer join 出来数据重复问题
hibernate多表查询
关键字: hibernate
我的demo小程序随着我学习的过程、体积也越来越庞大起来了、开始只是用来测试hibernate、渐渐的Spring,struts,dwr(我在用来做验证的过程因为异步,效果反而不好,所以后来拿掉了)的身影也出现了,到如今他已经有注册、登陆、发贴、查看主题、查看跟贴,回贴的能耐了,呵呵,为他而高兴。在前面学习的过程中先避开一些难点,比如多表查询、AOP切面编程等等,不过为了满足需求,今天开始将多表应用上去了,确实遇到了不少麻烦,花了不少的时间,当然在遇到问题,解决问题的过程中让我回顾了很多要点、盲点,也值了。
现在将关键点记录下来,以免日后再有相同问题出现,以便查阅。
二张表分别为用户表(users)和贴子表(notes),其中users中的userid是notes表的外键,users跟notes是一对多,多对一关系,由myEclpise自动生成映射文件
Users.hbm.xml
Java代码
......
<set name="noteses" inverse="true">
<key>
<column name="userid" not-null="true" />
</key>
<one-to-many class="com.note.model.Notes" />
</set>
.....
......
<set name="noteses" inverse="true">
<key>
<column name="userid" not-null="true" />
</key>
<one-to-many class="com.note.model.Notes" />
</set>
......
Notes.hbm.xml
Java代码
......
<many-to-one name="users" class="com.note.model.Users" fetch="select">
<column name="userid" not-null="true" />
</many-to-one>
......
......
<many-to-one name="users" class="com.note.model.Users" fetch="select">
<column name="userid" not-null="true" />
</many-to-one>
......
注意:如果多表查询,在写HQL语句时取notes的userid字段不能写notes.userid(这个问题下午我查了好久,才找到原因的)
HQL语句:From Notes notes,Users users WHERE notes.users=users.userid AND notes.issubject=1
又一注意点:该查询结果为存放对象数组的list集,可以用以下代码测试
Java代码
page=ins.listSubjects(page);//page是我的分页类,并存放了查询后的返回结果
List list=page.getResult();
System.out.println(page.getPageToolBar());
for(int i=0;i<list.size();i++){
Object[] obj=(Object[])list.get(i);
for(int j=0;j<obj.length;j++){
if(obj[j] instanceof Notes){
Notes note=(Notes)obj[j];
System.out.print(note.getTitle());
}else if(obj[j] instanceof Users){
Users user=(Users)obj[j];
System.out.print(user.getUsername());
}
}
System.out.println();
}
page=ins.listSubjects(page);//page是我的分页类,并存放了查询后的返回结果
List list=page.getResult();
System.out.println(page.getPageToolBar());
for(int i=0;i<list.size();i++){
Object[] obj=(Object[])list.get(i);
for(int j=0;j<obj.length;j++){
if(obj[j] instanceof Notes){
Notes note=(Notes)obj[j];
System.out.print(note.getTitle());
}else if(obj[j] instanceof Users){
Users user=(Users)obj[j];
System.out.print(user.getUsername());
}
}
System.out.println();
}
在jsp页面显示结果的时候我觉得用EL表达式会简单的多,如:
Java代码
<logic:present name="subjects">
<table width="100%" border="1" rules="rows" frame="below" cellpadding="5" cellspacing="0" bordercolorlight="#6C7BA6" bordercolordark="#ffffff" bgcolor="#DEEFFF" class="DoubleColorTable">
<logic:present name="subjects" property="result">
<logic:iterate id="objs" name="subjects" indexId="number" property="result">
<tr>
<td>
<html:link page="/listFollow.do?method=listFollow&subjectId=${objs[0].noteid}" styleId="link001">
主题:${objs[0].title}
</html:link>
</td>
<td>
作者:${objs[1].username}
</td>
<td>
发贴时间:${objs[0].addtime}
</td>
</tr>
</logic:iterate>
</logic:present>
</table>
<bean:write name="subjects" property="pageToolBar" filter="false" />
</logic:present>
<logic:present name="subjects">
<table width="100%" border="1" rules="rows" frame="below" cellpadding="5" cellspacing="0" bordercolorlight="#6C7BA6" bordercolordark="#ffffff" bgcolor="#DEEFFF" class="DoubleColorTable">
<logic:present name="subjects" property="result">
<logic:iterate id="objs" name="subjects" indexId="number" property="result">
<tr>
<td>
<html:link page="/listFollow.do?method=listFollow&subjectId=${objs[0].noteid}" styleId="link001">
主题:${objs[0].title}
</html:link>
</td>
<td>
作者:${objs[1].username}
</td>
<td>
发贴时间:${objs[0].addtime}
</td>
</tr>
</logic:iterate>
</logic:present>
</table>
<bean:write name="subjects" property="pageToolBar" filter="false" />
</logic:present>19:01 浏览 (12857) 评论 (17) 分类: java技术 进入论坛 收藏 相关推荐 评论
magic.chen 2007-09-11
请问:延迟加载能支持多表查询吗?支持的话,怎么去掉重复数据(set吗?),那要是排序呢?
sun113 2006-11-12
有收获,写得不赖!
wiley 2006-11-11
sun113 写道
又一注意点:该查询结果为存放对象数组的list集,可以用以下代码测试
请问list集中存放的是什么,使相关的user对象和note对象,对不对?
是的,list中存放你所查询对po的集合,多个对象以数组构建list
sun113 2006-11-11
又一注意点:该查询结果为存放对象数组的list集,可以用以下代码测试
请问list集中存放的是什么,使相关的user对象和note对象,对不对?
andyao 2006-11-09
今天用DWR+Spring做整合时,发现真的跟你说的一样,确实是只要显式访问时才加载,不过通过DWR去迟加载时说session已被关闭.这个问题怎么解决呢
ppm10103 2006-11-06
hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
--------
延迟加载加载的是代理类,如果不显示访问是不会加载内容的,
如果允许外连接也要控制一下连接深度
wiley 2006-11-05
hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
wiley 2006-11-02
santafeng 写道
wiley 写道
to:santafeng
引用
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
我也是初学hibernate,并不是很深入,你能详述你在多表查询时的做法吗?谢谢
这种设计使用hibernate无疑是鸡肋表现,无法解决。
那什么样的设计才使用hibernate呢?
santafeng 2006-11-02
wiley 写道
to:santafeng
引用
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
我也是初学hibernate,并不是很深入,你能详述你在多表查询时的做法吗?谢谢
这种设计使用hibernate无疑是鸡肋表现,无法解决。
wiley 2006-11-02
to:santafeng
引用
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
我也是初学hibernate,并不是很深入,你能详述你在多表查询时的做法吗?谢谢
wiley 2006-11-02
引用
注意:如果多表查询,在写HQL语句时取notes的userid字段不能写notes.userid(这个问题下午我查了好久,才找到原因的)
HQL语句:From Notes notes,Users users WHERE notes.users=users.userid AND notes.issubject=1
问下 为何不能写成notes.userid 而要notes.users?
Users(POJO)中没有userid成员
jd2bs 2006-11-02
注意:如果多表查询,在写HQL语句时取notes的userid字段不能写notes.userid(这个问题下午我查了好久,才找到原因的)
HQL语句:From Notes notes,Users users WHERE notes.users=users.userid AND notes.issubject=1
问下 为何不能写成notes.userid 而要notes.users?
santafeng 2006-11-02
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
cncomkyle 2006-11-01
我把你的查选考虑成外连接了,如果是外连接,会有出现null的情况
wiley 2006-11-01
obj[j]应该不会出现null,只有list才有可能出现null所以在循环外加if判断就可以了
cncomkyle 2006-11-01
if(obj[j] instanceof Notes){
Notes note=(Notes)obj[j];
System.out.print(note.getTitle());
}else if(obj[j] instanceof Users){
Users user=(Users)obj[j];
System.out.print(user.getUsername());
}
当obj[j]为null时的情况,怎么样处理呢
关键字: hibernate
我的demo小程序随着我学习的过程、体积也越来越庞大起来了、开始只是用来测试hibernate、渐渐的Spring,struts,dwr(我在用来做验证的过程因为异步,效果反而不好,所以后来拿掉了)的身影也出现了,到如今他已经有注册、登陆、发贴、查看主题、查看跟贴,回贴的能耐了,呵呵,为他而高兴。在前面学习的过程中先避开一些难点,比如多表查询、AOP切面编程等等,不过为了满足需求,今天开始将多表应用上去了,确实遇到了不少麻烦,花了不少的时间,当然在遇到问题,解决问题的过程中让我回顾了很多要点、盲点,也值了。
现在将关键点记录下来,以免日后再有相同问题出现,以便查阅。
二张表分别为用户表(users)和贴子表(notes),其中users中的userid是notes表的外键,users跟notes是一对多,多对一关系,由myEclpise自动生成映射文件
Users.hbm.xml
Java代码
......
<set name="noteses" inverse="true">
<key>
<column name="userid" not-null="true" />
</key>
<one-to-many class="com.note.model.Notes" />
</set>
.....
......
<set name="noteses" inverse="true">
<key>
<column name="userid" not-null="true" />
</key>
<one-to-many class="com.note.model.Notes" />
</set>
......
Notes.hbm.xml
Java代码
......
<many-to-one name="users" class="com.note.model.Users" fetch="select">
<column name="userid" not-null="true" />
</many-to-one>
......
......
<many-to-one name="users" class="com.note.model.Users" fetch="select">
<column name="userid" not-null="true" />
</many-to-one>
......
注意:如果多表查询,在写HQL语句时取notes的userid字段不能写notes.userid(这个问题下午我查了好久,才找到原因的)
HQL语句:From Notes notes,Users users WHERE notes.users=users.userid AND notes.issubject=1
又一注意点:该查询结果为存放对象数组的list集,可以用以下代码测试
Java代码
page=ins.listSubjects(page);//page是我的分页类,并存放了查询后的返回结果
List list=page.getResult();
System.out.println(page.getPageToolBar());
for(int i=0;i<list.size();i++){
Object[] obj=(Object[])list.get(i);
for(int j=0;j<obj.length;j++){
if(obj[j] instanceof Notes){
Notes note=(Notes)obj[j];
System.out.print(note.getTitle());
}else if(obj[j] instanceof Users){
Users user=(Users)obj[j];
System.out.print(user.getUsername());
}
}
System.out.println();
}
page=ins.listSubjects(page);//page是我的分页类,并存放了查询后的返回结果
List list=page.getResult();
System.out.println(page.getPageToolBar());
for(int i=0;i<list.size();i++){
Object[] obj=(Object[])list.get(i);
for(int j=0;j<obj.length;j++){
if(obj[j] instanceof Notes){
Notes note=(Notes)obj[j];
System.out.print(note.getTitle());
}else if(obj[j] instanceof Users){
Users user=(Users)obj[j];
System.out.print(user.getUsername());
}
}
System.out.println();
}
在jsp页面显示结果的时候我觉得用EL表达式会简单的多,如:
Java代码
<logic:present name="subjects">
<table width="100%" border="1" rules="rows" frame="below" cellpadding="5" cellspacing="0" bordercolorlight="#6C7BA6" bordercolordark="#ffffff" bgcolor="#DEEFFF" class="DoubleColorTable">
<logic:present name="subjects" property="result">
<logic:iterate id="objs" name="subjects" indexId="number" property="result">
<tr>
<td>
<html:link page="/listFollow.do?method=listFollow&subjectId=${objs[0].noteid}" styleId="link001">
主题:${objs[0].title}
</html:link>
</td>
<td>
作者:${objs[1].username}
</td>
<td>
发贴时间:${objs[0].addtime}
</td>
</tr>
</logic:iterate>
</logic:present>
</table>
<bean:write name="subjects" property="pageToolBar" filter="false" />
</logic:present>
<logic:present name="subjects">
<table width="100%" border="1" rules="rows" frame="below" cellpadding="5" cellspacing="0" bordercolorlight="#6C7BA6" bordercolordark="#ffffff" bgcolor="#DEEFFF" class="DoubleColorTable">
<logic:present name="subjects" property="result">
<logic:iterate id="objs" name="subjects" indexId="number" property="result">
<tr>
<td>
<html:link page="/listFollow.do?method=listFollow&subjectId=${objs[0].noteid}" styleId="link001">
主题:${objs[0].title}
</html:link>
</td>
<td>
作者:${objs[1].username}
</td>
<td>
发贴时间:${objs[0].addtime}
</td>
</tr>
</logic:iterate>
</logic:present>
</table>
<bean:write name="subjects" property="pageToolBar" filter="false" />
</logic:present>19:01 浏览 (12857) 评论 (17) 分类: java技术 进入论坛 收藏 相关推荐 评论
magic.chen 2007-09-11
请问:延迟加载能支持多表查询吗?支持的话,怎么去掉重复数据(set吗?),那要是排序呢?
sun113 2006-11-12
有收获,写得不赖!
wiley 2006-11-11
sun113 写道
又一注意点:该查询结果为存放对象数组的list集,可以用以下代码测试
请问list集中存放的是什么,使相关的user对象和note对象,对不对?
是的,list中存放你所查询对po的集合,多个对象以数组构建list
sun113 2006-11-11
又一注意点:该查询结果为存放对象数组的list集,可以用以下代码测试
请问list集中存放的是什么,使相关的user对象和note对象,对不对?
andyao 2006-11-09
wiley 写道
[quote=ppm10103 ]hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
--------
延迟加载加载的是代理类,如果不显示访问是不会加载内容的,
如果允许外连接也要控制一下连接深度
今天用DWR+Spring做整合时,发现真的跟你说的一样,确实是只要显式访问时才加载,不过通过DWR去迟加载时说session已被关闭.这个问题怎么解决呢
Hibernate文档里面有说明,应该多看看文档
19.1.1. Working with lazy associations
By default, Hibernate3 uses lazy select fetching for collections and lazy proxy fetching for single-valued associations. These defaults make sense for almost all associations in almost all applications.
Note: if you set hibernate.default_batch_fetch_size, Hibernate will use the batch fetch optimization for lazy fetching (this optimization may also be enabled at a more granular level).
However, lazy fetching poses one problem that you must be aware of. Access to a lazy association outside of the context of an open Hibernate session will result in an exception. For example:
Java代码
s = sessions.openSession();
Transaction tx = s.beginTransaction();
User u = (User) s.createQuery("from User u where u.name=:userName")
.setString("userName", userName).uniqueResult();
Map permissions = u.getPermissions();
tx.commit();
s.close();
Integer accessLevel = (Integer) permissions.get("accounts"); // Error!
s = sessions.openSession();
Transaction tx = s.beginTransaction();
User u = (User) s.createQuery("from User u where u.name=:userName")
.setString("userName", userName).uniqueResult();
Map permissions = u.getPermissions();
tx.commit();
s.close();
Integer accessLevel = (Integer) permissions.get("accounts"); // Error!
Since the permissions collection was not initialized when the Session was closed, the collection will not be able to load its state. Hibernate does not support lazy initialization for detached objects. The fix is to move the code that reads from the collection to just before the transaction is committed.
Alternatively, we could use a non-lazy collection or association, by specifying lazy="false" for the association mapping. However, it is intended that lazy initialization be used for almost all collections and associations. If you define too many non-lazy associations in your object model, Hibernate will end up needing to fetch the entire database into memory in every transaction!
On the other hand, we often want to choose join fetching (which is non-lazy by nature) instead of select fetching in a particular transaction. We'll now see how to customize the fetching strategy. In Hibernate3, the mechanisms for choosing a fetch strategy are identical for single-valued associations and collections.
wiley 2006-11-09
[quote=ppm10103 ]hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
--------
延迟加载加载的是代理类,如果不显示访问是不会加载内容的,
如果允许外连接也要控制一下连接深度
--------
延迟加载加载的是代理类,如果不显示访问是不会加载内容的,
如果允许外连接也要控制一下连接深度
今天用DWR+Spring做整合时,发现真的跟你说的一样,确实是只要显式访问时才加载,不过通过DWR去迟加载时说session已被关闭.这个问题怎么解决呢
Hibernate文档里面有说明,应该多看看文档
19.1.1. Working with lazy associations
By default, Hibernate3 uses lazy select fetching for collections and lazy proxy fetching for single-valued associations. These defaults make sense for almost all associations in almost all applications.
Note: if you set hibernate.default_batch_fetch_size, Hibernate will use the batch fetch optimization for lazy fetching (this optimization may also be enabled at a more granular level).
However, lazy fetching poses one problem that you must be aware of. Access to a lazy association outside of the context of an open Hibernate session will result in an exception. For example:
Java代码
s = sessions.openSession();
Transaction tx = s.beginTransaction();
User u = (User) s.createQuery("from User u where u.name=:userName")
.setString("userName", userName).uniqueResult();
Map permissions = u.getPermissions();
tx.commit();
s.close();
Integer accessLevel = (Integer) permissions.get("accounts"); // Error!
s = sessions.openSession();
Transaction tx = s.beginTransaction();
User u = (User) s.createQuery("from User u where u.name=:userName")
.setString("userName", userName).uniqueResult();
Map permissions = u.getPermissions();
tx.commit();
s.close();
Integer accessLevel = (Integer) permissions.get("accounts"); // Error!
Since the permissions collection was not initialized when the Session was closed, the collection will not be able to load its state. Hibernate does not support lazy initialization for detached objects. The fix is to move the code that reads from the collection to just before the transaction is committed.
Alternatively, we could use a non-lazy collection or association, by specifying lazy="false" for the association mapping. However, it is intended that lazy initialization be used for almost all collections and associations. If you define too many non-lazy associations in your object model, Hibernate will end up needing to fetch the entire database into memory in every transaction!
On the other hand, we often want to choose join fetching (which is non-lazy by nature) instead of select fetching in a particular transaction. We'll now see how to customize the fetching strategy. In Hibernate3, the mechanisms for choosing a fetch strategy are identical for single-valued associations and collections.
wiley 2006-11-09
[quote=ppm10103 ]hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
--------
延迟加载加载的是代理类,如果不显示访问是不会加载内容的,
如果允许外连接也要控制一下连接深度
今天用DWR+Spring做整合时,发现真的跟你说的一样,确实是只要显式访问时才加载,不过通过DWR去迟加载时说session已被关闭.这个问题怎么解决呢
ppm10103 2006-11-06
hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
--------
延迟加载加载的是代理类,如果不显示访问是不会加载内容的,
如果允许外连接也要控制一下连接深度
wiley 2006-11-05
hibernate多表查询时可以采用延迟加载来提高效率,这应该是一种方法吧,不过我还有一个问题,在1:N的情况下,如果是1:10000那延迟加载时是不是会把10000条都加载进来,能不能控时加载数量呀?
wiley 2006-11-02
santafeng 写道
wiley 写道
to:santafeng
引用
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
我也是初学hibernate,并不是很深入,你能详述你在多表查询时的做法吗?谢谢
这种设计使用hibernate无疑是鸡肋表现,无法解决。
那什么样的设计才使用hibernate呢?
santafeng 2006-11-02
wiley 写道
to:santafeng
引用
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
我也是初学hibernate,并不是很深入,你能详述你在多表查询时的做法吗?谢谢
这种设计使用hibernate无疑是鸡肋表现,无法解决。
wiley 2006-11-02
to:santafeng
引用
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
我也是初学hibernate,并不是很深入,你能详述你在多表查询时的做法吗?谢谢
wiley 2006-11-02
引用
注意:如果多表查询,在写HQL语句时取notes的userid字段不能写notes.userid(这个问题下午我查了好久,才找到原因的)
HQL语句:From Notes notes,Users users WHERE notes.users=users.userid AND notes.issubject=1
问下 为何不能写成notes.userid 而要notes.users?
Users(POJO)中没有userid成员
jd2bs 2006-11-02
注意:如果多表查询,在写HQL语句时取notes的userid字段不能写notes.userid(这个问题下午我查了好久,才找到原因的)
HQL语句:From Notes notes,Users users WHERE notes.users=users.userid AND notes.issubject=1
问下 为何不能写成notes.userid 而要notes.users?
santafeng 2006-11-02
这样做很好啊,不如用排序组合算法算了。拿出数据集合还需新组装成页面需求集合,几乎说是严重浪费人力物力表现。真不知道你是如何想得。
cncomkyle 2006-11-01
我把你的查选考虑成外连接了,如果是外连接,会有出现null的情况
wiley 2006-11-01
obj[j]应该不会出现null,只有list才有可能出现null所以在循环外加if判断就可以了
cncomkyle 2006-11-01
if(obj[j] instanceof Notes){
Notes note=(Notes)obj[j];
System.out.print(note.getTitle());
}else if(obj[j] instanceof Users){
Users user=(Users)obj[j];
System.out.print(user.getUsername());
}
当obj[j]为null时的情况,怎么样处理呢
发表评论
-
hibernate 一对多表查询时fetchMode.join 生成left outer join 出来数据重复问题
2010-09-06 20:58 5348hibernate 一对多表查询时fetchMode.join ... -
hibernate中执行标准原始sql需要注意的问题
2010-08-26 08:41 1683hibernate中执行标准sql需要注意的问题 关键字: ... -
个人心得Hibernate对视图的映射
2010-08-25 00:35 3435个人心得Hibernate对视图的映射 java技术 201 ... -
[org.hibernate.util.JDBCExceptionReporter] - 列名 'a_b_c' 无效。
2010-06-01 14:29 29462010-06-01 14:19:34,041 [main] ... -
Hibernate查询功能 hibernate hql使用 hibernate 使用sql 使用Query执行hql,不用find
2010-05-19 10:55 1991Hibernate查询功能 hibernate hql使用 h ... -
我的Hibernate学习笔记 Hibernate理解 hibernate知识要点
2010-05-18 13:34 1631Hibernate---我的Hibernate学习笔记 ... -
Hibernate集合过滤、子查询
2010-05-11 16:31 1470Hibernate集合过滤、子查 ... -
Hibernate中多对多关系的常见问题
2010-03-26 09:44 8441、到底在哪用cascade="..."? ... -
Hibernate通常是三种查询小结
2009-03-24 16:33 1610通常使用的Hibernate通常是三种:hql查询,QBC查询 ... -
Hibernate查询语言
2009-03-24 16:31 903第 15 章 HQL: Hibernate查询 ... -
Hibernate的缓存机制
2008-11-25 21:10 896Hibernate的缓存机制 1. Cache简介: ... -
Criteria進行查詢
2008-09-09 16:31 1460使用Criteria進行查詢時,不僅僅能組合出SQL中wher ... -
Hibernate中Criteria的完整用法
2008-07-21 14:26 2165Hibernate中Criteria的完整 ...
相关推荐
hibernate 多表查询 hibernate 多表不同于一般的sql嵌套查询,嵌套查询是不支持的,所以必须要配置好才能实现多表!只要配置好了,还是特别好用的
hibernate多表联合查询实例,很经典的查询语句和总结.
该源代码配了了解释,针对hibernate中多表查询的多种形式进行了总结,很有价值,有Object[]形式的查询,也有对象方式的查询 也有集合list形式的查询,
Hibernate连表查询 Hibernate连表查询
Hibernate多表查询.txt
hibernate多表查询[定义].pdf
Hibernate 多表连接分页查询示范项目 Hibernate Criteria 多表连接 分页
Hibernate 多表映射关系配置 如,一对一 多对一 多对多等
NULL 博文链接:https://08284008.iteye.com/blog/1456476
Hibernate多对多关联添加及查询示例
NULL 博文链接:https://gaoquanyang.iteye.com/blog/1213765
使用Struts2+Hibernate实现对部门表、员工表两张表的增删改查。
Hibernate中使用Criteria Query各种QBC查询
hibernate实现动态表查询的多种解决方案.自行整理的动太实现方案,总有一个适合你.
Hibernate_query查询数据表中的一个字段.
Hibernate_QBC查询
Hibernate中的关联查询实际上生成的是数据库表连接查询的SQL语句
利用MYSQL数据库提供的样例数据库world建立的查询小例子。已经建立好了数据库对应的...本项目主要是为了练习使用Hibernate查询数据库。如果有什么问题可以发站内信或者邮件asddf14@hotmail.com。我会尽量解答一下~~~
struts2+hibernate+spring多表操作
博客对应代码