I changed the mapping file from any to many-to-any and get this error during the schema-creation:
INFO: Mapping file: hbm/ena/ui/molecule/MoleculeText.hbm.xml
Jan 19, 2005 9:38:22 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: ena.ui.molecule.MoleculeText -> MoleculeText
Jan 19, 2005 9:38:22 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: hbm/ena/ui/panel/MoleculePanel.hbm.xml
Jan 19, 2005 9:38:22 PM net.sf.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: hbm/ena/ui/panel/MoleculePanel.hbm.xml(17) Attribute "name" must be declared for element type "many-to-any".
Jan 19, 2005 9:38:22 PM net.sf.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: hbm/ena/ui/panel/MoleculePanel.hbm.xml(17) Attribute "cascade" must be declared for element type "many-to-any".
Jan 19, 2005 9:38:22 PM net.sf.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: hbm/ena/ui/panel/MoleculePanel.hbm.xml(17) The content of element type "many-to-any" is incomplete, it must match "(meta-value*,column,column+)".
Jan 19, 2005 9:38:22 PM net.sf.hibernate.util.XMLHelper$ErrorLogger error
My mapping file is:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="ena.ui.panel">
<class name="MoleculePanel" table="MoleculePanel" >
<id name="Id">
<generator class="native"/>
</id>
<property name="PanelTitle"/>
<many-to-any name="moleculeVector"
meta-type="string"
id-type="long"
cascade="save-update">
<meta-value value="MoleculeText" class="ena.ui.molecule.MoleculeText"/>
<meta-value value="MoleculeDate" class="ena.ui.molecule.MoleculeDate"/>
<column name="molecule_TYPE"/>
<column name="molecule_ID"/>
</many-to-any>
</class>
</hibernate-mapping>
Thank you!
Richard
|