日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

hibernate左连接查询时在easyUI的dataGrid中有些行取值为空的解决办法

發布時間:2023/12/3 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 hibernate左连接查询时在easyUI的dataGrid中有些行取值为空的解决办法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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;

總結

以上是生活随笔為你收集整理的hibernate左连接查询时在easyUI的dataGrid中有些行取值为空的解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。