user is not mapped problem in SSH frame hibernate
When you do the SSH framework consolidation, when you are doing DAO operations. Only the Chekuser () method is called here. Run Times
user is not mapped error:
The Chekuser () method is as follows:
public boolean chekuser (user user) {
String hql= "from user U where u.id=? and u.name=? ";
Query query=getsession (). CreateQuery (HQL);
Query.setinteger (0, User.getid ());
Query.setstring (1, User.getname ());
List list=query.list ();
if (List.size () >0&&list!=null) {return true;}
return false;
}
When the above statement went wrong, because I wrote the HQL statement, the statement I wrote was:
String hql= "from user U where u.id=? and u.name=?";
but the table name in the HQL statement should be the class name of the ORM map, not the table name in your database.
So change the table name of the user in the HQL statement to user, and change the following:
String hql= "from User u where u.id=? and u.name=? ";
just change the class name to the ORM map.
In the second run will not be reported no XXX is not mapped wrong.
User is not mapped problem in SSH frame hibernate