首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

hibernateTemplate的find方法解决思路

2012-01-28 
hibernateTemplate的find方法hibernateTemplate里面的find的方法返回值都为List,如果我只需要查出一个的时

hibernateTemplate的find方法
hibernateTemplate里面的find的方法返回值都为List,如果我只需要查出一个的时候,是不是需要去遍历List啊,一般工作中是怎么使用hibernateTemplate啊,求解。

[解决办法]
if(list.size()>0)
 list.get(0);
[解决办法]
return list.size()==0?null:list.get(0);

热点排行