java - HTTP Status 500 - No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode -
i know question has been asked lot of times. have searched entire stack overflow, haven't been able out of it. understand exception arises when column name used in query different property specified in bean class, however, both of parameters same.
complete error:
java.lang.illegalstateexception: no data type node: org.hibernate.hql.internal.ast.tree.identnode +-[ident] identnode: 'iduserinfo' {originaltext=iduserinfo}
this query:
list<object[]> tuples = session.createquery( "select iduserinfo, sum(points) " + persistentclass.getname() + " group iduserinfo " + "order sum(points) desc").list();
and bean class:
@xmlrootelement @entity @table(name = "userinfo") public class userinfo { protected @xmlelement int id; protected @xmlelement int iduserinfo; protected @xmlelement int idquestion; protected @xmlelement string location; protected @xmlelement string state; protected @xmlelement string type; protected @xmlelement date timestamp; protected @xmlelement double latitude; protected @xmlelement double longitude; protected @xmlelement integer points;
the query runs parameters except iduserinfo , idquestions. column names in table have same parameters, although read somewhere doesn't matter, need match parameters bean classes!
i solved issue changing column names "iduserinfo" , "idquestion" "user" , "question" respectively. think reason there parameter "id". don't understand why causing problem, changing column name not remotely parameter "id" did trick me!
Comments
Post a Comment