Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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

 
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


 
author and cow tipper
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
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
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!