Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Hibernate Mapping Files Ignored

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have successfully been able to run hiberante hitting my Oracle database with reads, inserts, deletes and updates. Problem is that I can't get the mapping xml files to load. Currently I'm loading each class individually that is obviously not workable for a large scale project.

I tried specifying the files in the configuration file without luck with these different attempts:
<mapping resource="/com/mypackage/User.hbm.xml" />
<mapping resource="com/mypackage/User.hbm.xml" />
<mapping file="com/mypackage/User.hbm.xml" />
<mapping file="/com/mypackage/User.hbm.xml" />

Yes, the xml files are in the classpath and yes the xml files are properly formed since they work when loaded individually.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


<mapping resource="com/mypackage/User.hbm.xml" />


Works fine on the application I'm currently working on. As you know the mapping files and POJOs need to be in the classpath, matching their package structure. What actual exception are you seeing when you configure your SessionFactory?
 
Steven Martin
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the individual load case I get:

net.sf.hibernate.MappingException: Unknown entity class: com.mypackage.User
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic