dao层
//获取nodeindex最大值,没有则为1,否则最大值加1返回
public List<TMenu> findNodeIndex(long id){
String isSql = "select max(to_number(t.node_index)) from t_me t where t.superior_id = "+id;
return (List<TMenu>) this.queryBySql(isSql);
// if(nodeList==null){
// return "1";
// }
// return nodeList.get(0);
}actiong层 List<TMe> tMeList= cdglService.findNodeIndex(superiorId);
System.out.println("========"+tMeList.size());
for(int i =0;i<tMeList.size();i++){
System.out.println((TMe)tMeList.get(i).getNodeIndex());
}
System.out.println("========"+tMeList.get(0).getNodeIndex());tMeList.get(i).getNodeIndex();
这个得不到??写的有问题么??
//获取nodeindex最大值,没有则为1,否则最大值加1返回
public List<TMenu> findNodeIndex(long id){
String isSql = "select max(to_number(t.node_index)) from t_me t where t.superior_id = "+id;
return (List<TMenu>) this.queryBySql(isSql);
// if(nodeList==null){
// return "1";
// }
// return nodeList.get(0);
}actiong层 List<TMe> tMeList= cdglService.findNodeIndex(superiorId);
System.out.println("========"+tMeList.size());
for(int i =0;i<tMeList.size();i++){
System.out.println((TMe)tMeList.get(i).getNodeIndex());
}
System.out.println("========"+tMeList.get(0).getNodeIndex());tMeList.get(i).getNodeIndex();
这个得不到??写的有问题么??
List<TMe> tMeList= cdglService.findNodeIndex(superiorId);
System.out.println("========"+tMeList.size());
//循环以前加个判断。
if(tMeList.size()>0){
for(int i =0;i<tMeList.size();i++){
System.out.println((TMe)tMeList.get(i).getNodeIndex());
}
}
//要把bug尽量降到最低。。
System.out.println("========"+tMeList.get(0).getNodeIndex());debug逐步追踪错误一次就知道哪写错了。找不到就把错误信息贴出来
2.debug才是王道
再看看List<TMe> tMeList= cdglService.findNodeIndex(superiorId);
tMeList有没有值,应该很快就能找出来哪错了的。
怎么在action中的用List<TMe> tMeList去接受值的,
应该是类型不匹配吧