Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate.MappingException: table refers to an unmapped class

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my main class


this is my student.hbm file


this is my Address.hbm file




this is my student .java file


this is my address.java file


here is the error i got when i am going to run main file


 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An association from the table STUDENT refers to an unmapped class: com.vaannila.student.Address


Would suggesting that com.vaannila.student.Address is unmapped be too obvious? Perhaps the hbm file is in the wrong spot and not being read.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
I put classes in default package.
anyway is it a must to implelement a Serilizable interface each java class when using Hibernate?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a requirement of any good JavaBean, according to the JavaBean spec, to implement Serializable. Hibernate won't cough up locally if you don't explicitly add the 'implements' but you might run into problems later on when you go into production and start passing around entities between cluster members.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic