hibernate左连接查询时在easyUI的dataGrid中有些行取值为空的解决办法
2024-08-24 19:45:54
1 当使用left join左连连接,sql语句为
select t from SecondPage t left join t.rightNavbar n where 1=1
页面中出现了部分空行的情况,上述语句返回的list集合为
DataGrid dataGrid = new DataGrid();
List<SecondPage> list=secondPageDao.find(model, paging);
dataGrid.setRows(list);
dataGrid.setTotal(secondPageDao.count(model));
return dataGrid;
遍历list的值,发现list里边的每一项都是有值的,我就没有理解,为什么直接把listset到row中,页面上就是有空格存在,但是我加了下面代码后解决了这个问题,如果有经验的朋友欢迎提供说明
DataGrid dataGrid = new DataGrid();
List<SecondPage> list=secondPageDao.find(model, paging);
Iterator<SecondPage> it = list.iterator();
/**解决空格的问题,前台取不到值**/
List<SecondPage> listCopy = new ArrayList<SecondPage>();
while (it.hasNext()) {
SecondPage s = (SecondPage) it.next();
SecondPage copy = new SecondPage();
BeanUtils.copyProperties(s, copy);
listCopy.add(copy);
}
/**结束**/
dataGrid.setRows(list);
dataGrid.setTotal(secondPageDao.count(model));
return dataGrid;
最新文章
- 多线程的通信和同步(Java并发编程的艺术--笔记)
- php安装程序
- windows2003 iis php 配置后无法执行php页面
- Codeforces Round #381 (Div. 2) A B C 水 构造
- [SLAM] 02 Some algorithms of 3D reconstruction
- 命令行bash的基础操作
- UESTC_Little Deer and Blue Cat CDOJ 1025
- Easyui登陆页面制作
- ThinkPHP - 独立分组项目搭建
- Ubuntu下编译Android JNI最靠谱的方法...
- FastDFS的学习与使用(大量帖子)
- php数据分页显示基础
- 本地mysql无法连接原来是这里有问题啊。。。。。。
- MySQL中UTF8编码的数据在cmd下乱码
- Fiddler--Composer
- not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
- C#中e.Cancel,e.Handled的区别与应用
- 深入JAVA注解之属性注解
- html注释快捷键
- 转: Photon 3.4 Changed Logs ..
热门文章
- mysql将多条结果拼接成一条结果
- [技术博客] win10下vagrant+centos7 rails虚拟开发机配置流程
- elasticsearch-py 解决 too_long_frame_exception 问题
- el-select获取选中的value和label
- C#实现图像拖拽以及锚点缩放功能
- 阿里云OSS设置跨域访问 H5的时候
- 【转】CAD 二次开发--属性块 Block和BlockReference
- 安装 create-react-app@latest 失败,错误代码:243
- django学习问题集
- 报错:pymysql.err.InternalError: (1054, ";Unknown column &#39;AType&#39; in &#39;field list&#39;";)