after much googling now confused and frustrated.
I am upgrading an application from Hibernate 3 to 4. This works well using dtd 3.0 but now need to use the 4.0 xsd and this is where every thing goes base over apex!
The app uses hbm.xml files to configure each entity, no annotations anywhere.
It would be very useful to find an example of an hbm file but even tutorials for hibernate 4 just use the 3.0 dtd!
I am using the following
<hibernate-mapping
xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping hibernate-mapping-4.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
package="org.hibernate.metamodel.binding">
Using this I get an LONG list of errors the root cause being
Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 51; cvc-elt.1: Cannot find the declaration of element 'hibernate-mapping'.
My reading of multiple Google pages suggest that I still need a doctype which is confusing and I think I am just misunderstanding and when I do add a doctype Eclipse complains about the definition of the hibernate-mapping element. Ignoring that error (just incase problem with eclipse config) get the same as a run time error:
Attribute "xmlns" must be declared for element type "hibernate-mapping"
I have been unable to find a tutorial or an example of an hbm.xml file that uses the hibernate 4 xsd.
Can anyone please put me out of my misery ?