Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unmapped entity

 
Vallaru smitha
Ranch Hand
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

have 2 tables for which i have created a pojo with required fields and running hibernateUtil.createsql query. Below is my query



but I am getting a nullpointer when i try. Could any one please suggest me where I am doing wrong or if there is any other way.

thanks
 
Anantha Sharma
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to use openSession instead of getCurrentSession()... since the thread doesnot have a session linked to it (refer to OpenSessionInViewFilter), the getCurrentSession() would return null.. hence the exception.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic