try using hibernate to build a Web project for yourself tonight, and then go for a simple login.
This error is always reported when doing query operations through Hibernate:
Users are not mapped.
So to check the next mapping, found no problem ah, repeated verification results are the same error.
User.hbm.xml:
<class name= "Com.lian.bean.User" table= "Users" >
Hibernate.cfg.xml:
<mapping resource= "Com/lian/bean/user.hbm.xml"/>
On the internet to find a lot, but still do not give force, we did not mention some constructive solutions, basically said configuration has a problem.
But I feel like this is a problem:
String sql = "Select U.password fromUsersu where u.username= ' "+user.getusername () +" ' ";
After a lot of tangled and patient looking for information, found:
OriginallyThe table name in the HQL statement should be the class name of the ORM map, so it should be changed to:
String sql = "Select U.password fromUseru where u.username= ' "+user.getusername () +" ' ";
hahaha, this gives all the people!!! of similar problems in the process of beginners hibernate
Users are not mapped issues in Hibernate (GO)