-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Mapping Exception: Duplicate Import:
PostPosted: Wed Jan 28, 2004 11:56 pm 
Newbie

Joined: Wed Jan 28, 2004 11:20 pm
Posts: 4
I have been through all of the posts on this but still have not clue as to
how to resolve this.

The most frequent responce seems to be : "this is a DTD violation"
however I have created the Mapping file with a vlidating Editor
and it passes all standard it appears to validate against the DTD
just fine.

I have also tried re-ordering the classes but with no effect.

The offending mapping file bieng:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
                                   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
  <class name="rats.model.Product" table="product">
    <id column="ID" name="id" type="long">
      <generator class="sequence"/>
    </id>
    <many-to-one class="Manager" column="Manager" name="manager"/>
    <property column="Name" length="127" name="name" type="string"/>
    <property column="Code" length="10" name="code" type="string"/>
  </class>
  <class name="rats.model.Test" table="test">
    <id column="ID" name="id" type="long">
      <generator class="sequence"/>
    </id>
    <property column="Name" length="127" name="name" type="string"/>
    <many-to-one class="Manager" column="Manager" name="manager"/>
    <set name="products" table="TestProduct">
      <key column="Test"/>
      <many-to-many class="Product" column="Product"/>
    </set>
  </class>
  <class name="rats.model.Manager" table="manager">
    <id column="ID" name="id" type="long">
      <generator class="sequence"/>
    </id>
    <property column="Name" length="127" name="name" type="string"/>
    <set name="Products">
      <key column="Manager"/>
      <one-to-many class="Product"/>
    </set>
    <set name="tests">
      <key column="Manager"/>
      <one-to-many class="Test"/>
    </set>
  </class>
  <class name="rats.model.Number" table="number">
    <id column="ID" name="id" type="long">
      <generator class="sequence"/>
    </id>
    <many-to-one class="Advisor" column="Advisor" name="advisor"/>
    <many-to-one class="Manager" column="Manager" name="manager"/>
    <property column="Number" length="50" name="number" type="string"/>
  </class>
  <class name="rats.model.Testattempt" table="testattempt">
    <id column="ID" name="id" type="long">
      <generator class="sequence"/>
    </id>
    <many-to-one class="Advisor" column="Advisor" name="advisor"/>
    <many-to-one class="Test" column="Test" name="test"/>
    <property column="Passed" length="1" name="passed" type="integer"/>
    <property column="Date" length="19" name="date" type="timestamp"/>
  </class>
  <class name="rats.model.Advisor" table="advisor">
    <id column="ID" name="id" type="long">
      <generator class="sequence"/>
    </id>
    <property column="Code" length="8" name="code" type="string"/>
    <property column="Name" length="127" name="name" type="string"/>
    <set name="testattempts">
      <key column="Advisor"/>
      <one-to-many class="TestAttempt"/>
    </set>
    <set name="numbers">
      <key column="Advisor"/>
      <one-to-many class="Number"/>
    </set>
  </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Found the problem
PostPosted: Thu Jan 29, 2004 1:30 am 
Newbie

Joined: Wed Jan 28, 2004 11:20 pm
Posts: 4
As noted else where the error message generated is less then informative.

the actuall problem in this instance was with class references inside my
<set ... /> tags not being qualified with the package name.

regards

konrad


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 7:24 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It'll be fixed in the 2.1.2 version AFAIK

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.