Error message:
ERROR dispatcher:38-exception occurred during processing request:user is isn't mapped [from user where username =?]; Nested exception is org.hibernate.hql.ast.QuerySyntaxException:user are not mapped [from user where username =?]
Org.springframework.orm.hibernate3.HibernateQueryException:user is isn't mapped [from user where username =?]; Nested exception is org.hibernate.hql.ast.QuerySyntaxException:user are not mapped [from user where username =?]
......
Caused By:org.hibernate.hql.ast.QuerySyntaxException:user is isn't mapped [from user where username =?]
......
See the first reaction of the information, mapping error
1. Are there any User.hbm.xml files
2. Whether the profile is loaded into the Hibernate entities list
3. Whether the mapping file field is consistent with the database field, with the correct keyword
Still wrong (since it's not the user's fault, it's a database problem)
Convenient for diagram start database dialect is mysqldialect, compatibility may be a problem, change to Mysql5dialet, that is, configure <prop key= "Hibernate.dialect" > Org.hibernate.dialect.MySQL5dialect</prop>
--Still error (* * database statement error?) **)
String hql = "from user where username =?";
list<user> list = This.gethibernatetemplate (). Find (hql, username); Error???
Focus : HQL uses entity query technology, such as the following example: String hql= "from user User"; List list=session. CreateQuery (HQL). List (); The result of the above code execution is to query out all the data corresponding to the user entity object , and encapsulate the data into a user entity object, and put it back in the list
Therefore, the above HQL statement error, HQL statement, must be an object query, especially "TableName" do not write the table you want to query, but the object of the query
(Here, user is the database table name and the user object should be queried)
SSH execution HQL error: caused by:org.hibernate.hql.ast.QuerySyntaxException:user is not mapped [from user where username =?]