dcsimg
Problem in Hibernate
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Saturday, October 8, 2005 02:07 AM

Problem with mapping to table in hibernate This is my coding. session=session.getSession(); Creteria ct = session.createCreteria(User.class); ct.add(Expression.eq("userId",userId); When i execute this code what i got is Hibernate:select this_.userId as userId0_, this_.password as password0_0 from users this_ where this_.userId=? if i use the createQuery with same mapping what i got is Unkonwn column 'this_.userId' in 'field list' hibernate.util.JDBCExceptionReporter i had configured the User.hbm.xml correctly.    More>>

Problem with mapping to table in hibernate



This is my coding.


session=session.getSession();

Creteria ct = session.createCreteria(User.class);

ct.add(Expression.eq("userId",userId);



When i execute this code what i got is



Hibernate:select this_.userId as userId0_,

this_.password as password0_0 from users

this_ where this_.userId=?



if i use the createQuery with same mapping

what i got is



Unkonwn column 'this_.userId' in 'field list'

hibernate.util.JDBCExceptionReporter



i had configured the User.hbm.xml correctly.



but when hibernate is going to execute mapping file

the fields for every field name it is adding 0 at the
end of the field name.



Any body please solve my problem. hoping your reply.

   <<Less
About | Sitemap | Contact