Hibernate version: 3.1
SGBD: Oracle
Table one
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class
name="Evento"
table="EVENTO"
>
<id
name="id"
type="integer"
column="NRO_EVENTO"
>
<generator class="sequence">
<param name="sequence">S_NRO_EVENTO</param>
</generator>
</id>
. . .
<set name="evRelatos" table="EV_RELATO" inverse="true" lazy="true" cascade="all-delete-orphan">
<key column="NRO_EVENTO"/>
<one-to-many class="EvRelato"/>
</set>
</class>
</hibernate-mapping>
Table twoCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class
name="EvRelato"
table="EV_RELATO"
>
<id name="id" column="NRO_EVENTO" type="integer">
<generator class="Evento">
<param name="property">nroEvento</param>
</generator>
</id>
. . .
<many-to-one
name="NroEvento"
column="NRO_EVENTO"
class="Evento"
>
</many-to-one>
</class>
</hibernate-mapping>
error in mapping:Code:
INFO Configuration:1057 - processing foreign key constraints
Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for entity: EvRelato column: NRO_EVENTO (should be mapped with insert="false" update="false")
The tables cannot be modified