Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not parse mapping document hbm.xml  RSS feed

 
sarada bokka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am having user table with userid and password .

hibernate.cfg.xml



User.hbm.xml



User.java




in my class i am trying to call

HibernateUtil.createSessionFactory();

it has thrown the error in the above statment

Could not parse mapping document from resource com/tricky/vo/User.hbm.xml


could anyone let me know what was the error in User.hbm.xml
 
Christian Dillinger
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could read the complete message: Caused by: org.hibernate.MappingException: Unable to determine entity name

You don't tell Hibernate the name of the class you are mapping. Fill the attribute "name" in your hbm.xml-File.
 
sarada bokka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help . It's working fine now
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!