为什么按学号查询,查哪个学号都显示所有

public List getList(int xh)
{
String where="";
if(xh!=0)
{
where=where+" where xuehao="+xh+"";
}
return this.findAll(where);
}

下边是findAll方法
private List<Xuesheng>  findAll(String where)
{
       Session sess = this.getSessionFactory().openSession();
         try
         {
          Query query = sess.createQuery(" From  Xuesheng " + where + " order by id ");
          return query.list();
         }
         finally
         {
            sess.close();
         }
}
查看全部
baidu_29643173
baidu_29643173
2015/07/08 05:41
  • 求详解 求改正
  • 点赞
  • 收藏
  • 回答
    私信

15个回复