• 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

One to Many Mapping : org.hibernate.MappingException: Association references unmapped class  RSS feed

 
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm having 2 entity Student and Address trying to do 12M

Student


student.hbm.xml


Address.java


address.hbm.xml


i'm getting followin problem Log

INFO: Reading mappings from resource : com/hbm/student.hbm.xml
Nov 30, 2011 12:56:11 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: com.home.student.Student -> STUDENT
Nov 30, 2011 12:56:11 AM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Exception in thread "main" org.hibernate.MappingException: Association references unmapped class: com.home.student.Address
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2380)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2662)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at com.home.student.Demo.main(Demo.java:18)
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is your com/hbm/address.hbm.xml in the same location as com/hbm/student.hbm.xml and is it declared in your hibernate,cfg.xml?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!