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 Problem of Unknown Entity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem of Unknown Entity" Watch "Problem of Unknown Entity" New topic
Author

Problem of Unknown Entity

SanjayR Jain
Ranch Hand

Joined: Mar 05, 2009
Posts: 43
I have added hbm.xml mapping in hibernate.cfg.xml. But it is not reading this hbm file during run time and giving me below exception.

Om Tejas
Greenhorn

Joined: Dec 02, 2009
Posts: 27
The exception suggests that the class file mentioned in .cfg.xml and .hbm file is not correct. May be a spelling mistake. Verify this.

If this not solved your problem , post your hibernate.cfg.xml file and .hbm file.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Or the T&C class isn't being deployed.
SanjayR Jain
Ranch Hand

Joined: Mar 05, 2009
Posts: 43
Here is my .cfg.xml file


Here is my termandcondition.hbm.xml fie



As you can see I have added my termandcondition.hbm.xml file in .cfg.xml file in the last.
All other .hbm working fine.

And for the TermAndCondition.java I have putted a jar file on th server side where all the hbm files putted.

SanjayR Jain
Ranch Hand

Joined: Mar 05, 2009
Posts: 43
hello
What I really want to do that to save an new TermAndCondition.java in to the database.
For that I just made a new instance in my dao class and called the method saveOrUpdate of the session.
Then it is giving error which I posted in my first post.
i.e. My .cfg.xml is not getting the termandcondition.hbm.xml

Now what I did is in my TermAndCondition bean class I made a default constructor.Now it wrking properly.
But this is bit of confusing for me Because need of constructor will be at the time of making new instance for saving.Not at the time
when searching of .hbm.xml in the cfg.xml file.

Si how it is working properly?
 
Consider Paul's rocket mass heater.
 
subject: Problem of Unknown Entity