Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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

 
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: 5000
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: 5000
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
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic