Hibernate version:2
Hi all!
I want mapping 2 entity, Testata and Eccipienti. They've a one-to-many relationship: a Testata can have many Eccipienti and an Eccipienti can have only a Testata.
In Eccipienti I've a composite-id... so I map:
Code:
...
<hibernate-mapping package="com.omeopatici.dati.db.struttureDati" >
<class name="Eccipienti" table="Eccipienti">
<composite-id >
<key-property name="codscheda" column="codscheda" type="int" />
<key-property name="riga" column="riga" type="int" />
</composite-id>
<property name="descrizione" column="descrizione" type="String" />
....
....
</class>
And I've map Testata and relationship:
Code:
...
<hibernate-mapping package="com.omeopatici.dati.db.struttureDati" >
<class name="Testata" table="Testata" lazy="true">
<id name="codscheda" column="codscheda" type="int">
<generator class="native" />
</id>
.....
.....
<set name="eccipienti" lazy="true" inverse="true">
<key column ="codscheda"/>
<key column ="riga"/>
<one-to-many class="Eccipienti" />
</set>
</class>
But when I do hbm2java Eccipienti.hbm.xml Testata.hbm.xml I've this error:
Quote:
13-lug-2005 10.40.16 net.sf.hibernate.tool.hbm2java.CodeGenerator$1 error
GRAVE: Error parsing XML: file:/C:/hibernate-2.1/tools/bin/Testata.hbm.xml(62)
org.xml.sax.SAXParseException: The content of element type "set" must match "(meta*,(cache|jcs-cache
)?,key,(element|one-to-many|many-to-many|composite-element|many-to-any))".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(
Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:707)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:689)
at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:100)
13-lug-2005 10.40.16 net.sf.hibernate.tool.hbm2java.Generator generate
INFO: Generating 2 in generated
Where's the error? How can I map this relationship?
Please, help me :(