Hi,
Am using Hibernate 2.1. with MySql. When I try to run my project I am getting the MappingException:
09:44:17,828 INFO [Configuration] configuring from resource: /hibernate.cfg.xml
09:44:17,828 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
09:44:17,843 INFO [Configuration] Mapping resource: au/com/isell/test/Product.hbm.xml
09:44:17,859 ERROR [Configuration] Could not compile the mapping document
net.sf.hibernate.MappingException: duplicate import: Product
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
what does this mean please? I have one object - Product, with one mapping file:
<hibernate-mapping>
<class name="au.com.isell.test.Product" table="products">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name">
<column name="name" sql-type="char(255)" not-null="true"/>
</property>
<property name="price">
<column name="price" sql-type="double" not-null="true"/>
</property>
<property name="amount">
<column name="amount" sql-type="integer" not-null="true"/>
</property>
</class>
</hibernate-mapping>
my config XML is thus:
<hibernate-configuration>
<session-factory name="java:comp/env/hibernate/SessionFactory">
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">
jdbc:mysql:///hibernate_tutorial</property>
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.username">xxx</property>
<property name="hibernate.connection.password">xxx</property>
<mapping resource="au/com/isell/test/Product.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I have only one instance of this object, with only one mapping. What is being duplicated?
thanks for any help
Paul.
|