Hibernate version: 3.2
Code:
<class name="src.WikiObject" abstract="true">
<id name="id" column="uid" type="long">
<generator class="increment"/>
</id>
<property name="name" not-null="true"/>
<!-- CONTINENT -->
<union-subclass name="src.Continent" table="`Continent`">
<property name="area" type="integer"/>
<property name="weather" type="text"/>
</union-subclass>
<!-- COUNTRY -->
<union-subclass name="src.Country" table="`Country`">
<property name="capitol" type="integer"/>
<property name="currency" type="integer"/>
<set name="toContinent" table="`Link_Country2Continent`">
<key column="uid"/>
<many-to-many column="uid" class="src.Continent"/>
</set>
</union-subclass>
</class>
gives me this error:
Code:
Initial SessionFactory creation failed.org.hibernate.MappingException: Repeated column in mapping for collection: src.Country.toContinent column: uid
The needed part is in "Country" mapping, where we define a many-to-many-association between two classes, which have the different identifiers but with SAME name, which seems to be a little bit too complicating for Hibernate - is it?