File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate Mapping Files Ignored Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Mapping Files Ignored" Watch "Hibernate Mapping Files Ignored" New topic
Author

Hibernate Mapping Files Ignored

Steven Martin
Greenhorn

Joined: Dec 03, 2001
Posts: 25
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.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


<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?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Steven Martin
Greenhorn

Joined: Dec 03, 2001
Posts: 25
For the individual load case I get:

net.sf.hibernate.MappingException: Unknown entity class: com.mypackage.User
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Mapping Files Ignored
 
Similar Threads
MappingNotFoundException
Issue in Inserting / Updating the table with trigger using Hibernate
The user must supply a JDBC connection - Hibernate Error
Urgent help deploying hibernate app
Problem with Hibernate Cache