Hi, my problem is following:
i have 2 .xml files:
Code:
<hibernate-mapping>
<class name="mypackage.Hospital" table="hospital">
<id name="id" column="id" type="java.lang.Integer">
<generator class="increment"/>
</id>
<property name="bez" column="bez" type="java.lang.String" />
<property name="plz" column="plz" type="java.lang.String" />
<set name="patienten" cascade="all" lazy="true">
<key column="hospital"/>
<one-to-many class="mypackage.Patient"/>
</set>
</class>
</hibernate-mapping>
and this one:
Code:
<hibernate-mapping>
<class name="mypackage.Patient" table="patient">
<id name="sv_nr" column="sv_nr" type="java.lang.Integer">
</id>
<property name="plz" column="plz" type="java.lang.String" />
<property name="email" column="email" type="java.lang.String" />
<property name="hospital" column="hospital" type="mypackage.Hospital" />
<many-to-one name="hospital" column="hospital" class="mypackage.Hospital"/>
</class>
</hibernate-mapping>
the relations is one patient could only be in one hospital - but one hospital could contain of a lot of patient... hospital - patient ==> many-to-one
My Error:
Code:
Could not initialize the Hibernate configuration
null
org.hibernate.MappingException: Duplicate property mapping of hospital found in mypackage.Patient
i don't know if my mappping is right:/
i hope this was enough information -
thx 4 help ..