GeeCON Prague 2014*
The moose likes Object Relational Mapping and the fly likes Validating Hibernate mapping file with -set- and -join- elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Validating Hibernate mapping file with -set- and -join- elements" Watch "Validating Hibernate mapping file with -set- and -join- elements" New topic
Author

Validating Hibernate mapping file with -set- and -join- elements

M Navasca
Greenhorn

Joined: Oct 25, 2007
Posts: 2
Using Hibernate 3

I have a problem validating a mapping file that contains and elements.

Java classes:






DB Tables (Postgresql 8.2):



* tbl_agents and tbl_agenthistories are 1-to-1
* tbl_agents and tbl_retailproperties are 1-to-n
* I have no control over the db schema (ie. I cannot change it)


Agent.hbm.xml:



RetailProperty.hbm.xml:



RetailProperty.hbm.xml validates. But when I try to validate Agent.hbm.xml I get this:



Which usually means to me that something is wrong with the mapping file. Is there anything in my mapping files that I'm missing?

Note that when I comment out either the <set> or <join> element in Agent.hbm.xml it validates.
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
When I put the <set> before the <join>, the mapping file validates. Apparently, the DTD requires this order.
[ October 26, 2007: Message edited by: Edvins Reisons ]
M Navasca
Greenhorn

Joined: Oct 25, 2007
Posts: 2
Hey that worked! I can't believe it was something so trivial.

thanks
gopi nath
Greenhorn

Joined: Oct 05, 2006
Posts: 15
HI
I think we have to use the elements in the order what defined in the DTD?
Am I right?
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
Yes, this is exactly what we have discussed here.
 
GeeCON Prague 2014
 
subject: Validating Hibernate mapping file with -set- and -join- elements