wood burning stoves*
The moose likes Object Relational Mapping and the fly likes One to Many relationship Error. Please guide. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "One to Many relationship Error. Please guide." Watch "One to Many relationship Error. Please guide." New topic
Author

One to Many relationship Error. Please guide.

Ajay Luthria
Greenhorn

Joined: Jul 15, 2009
Posts: 5
I am trying to set one to many relation between a trade and trade details.
One trade object can have multiple trade details and status's.

I am getting the error:

Error reading resource: Trade.hbm.xml

Please suggest if I have overlooked anything?

Thanks a lot and much appreciated for all the help.


Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Remove Trade.hbm.xml from the hibernate.cfg.xml file and see if you get the same error with TradeDetails. I'm wondering if it's just a classpath issue.

-Cameron McKenzie
Ajay Luthria
Greenhorn

Joined: Jul 15, 2009
Posts: 5
Cameron Wallace McKenzie wrote:Remove Trade.hbm.xml from the hibernate.cfg.xml file and see if you get the same error with TradeDetails. I'm wondering if it's just a classpath issue.

-Cameron McKenzie


Hi Cameron,

Tried what you suggested and getting this error now:



It works fine when I comment out TradeDetails.hbm.xml from the Hibernate.cfg.xml and comment out one to many relation from the Trade.hbm.xml
If I run the test harness just on the Trade,the trade is saved in the trade table.....

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: One to Many relationship Error. Please guide.