判断参数和数据库数据是否重复最简单的方法

来源:互联网 发布:网络兼职项目 编辑:程序博客网 时间:2024/04/30 14:17
public  boolean getReportId(Long id){   int count = 0;     //查询数据库ID   Long ids = ......;   for(Long i : ids){       if(i == id){           count++;    }  if(count>1){     return false;  }return true;}

0 0
原创粉丝点击