• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not parse mapping document hbm.xml

 
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!