SSH关于通过User登录user is not mapped [from user where userName=? and password=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: user is not mapped [from user where userName=? and password=?]
看图
查看dao中的代码
List<User> list= find("from user where userName=? and password=?",new String[]{userName, password});
return list.get(0);
这里的from user 这个user代表表明 ,这样是不可以的
下面正确写法将user换成User 。from是针对User这个类,而不是这个表user:
List<User> list= find("from Userwhere userName=? and password=?",new String[]{userName, password});
return list.get(0);
Lucas科技:
csdn博客:https://blog.youkuaiyun.com/qq_43084651
github:https://github.com/LLLLucas/-