properties are generated twice

Description

The reverse engineering file looks like that:

<column name="FK_TBENUSTAT_ISTATUS" jdbc-type='' property="benutzerStatus" type="najs.model.BenutzerStatus" />
<foreign-key constraint-name="PK_TBENUTZER_STATUS" foreign-table="TBENUTZER_STATUS">
<column-ref local-column="FK_TBENUSTAT_ISTATUS" foreign-column="ISTATUS" />
<many-to-one property="benutzerStatus"/>
</foreign-key>

Then the model class has a property:
private BenutzerStatus benutzerStatus;

The table TZUGANG has also a foreign key which points to the TBENUTZER table.It's defined like that in the TZUGANG table mapping (reveng file):

<column name="FK_TBENU_ILAUFNR" jdbc-type='' property="benutzer" type="najs.model.Benutzer" />
<foreign-key constraint-name="PK_TBENUTZER" foreign-table="TBENUTZER">
<column-ref local-column="FK_TBENU_ILAUFNR" foreign-column="ILAUFNUMMER"/>
<many-to-one property="benutzer"/>
</foreign-key>

The model class Zugang.java is created and has a property
private Benutzer benutzer;

if i take a look at the Benutzer class again, i can see the inverse mapping to the table TZUGANG and there are suddenly two more properties defined:

private Set tzugangsForFkTbenuIlaufnr = new HashSet(0);

private Set tzugangsForFkTbenuIlaufnr_1 = new HashSet(0);

This sould not be the case i think, only one property should be created.

Environment

Eclipse 3.1, HIbernate 3.1, Oracle 10

Activity

Show:

Max Rydahl AndersenApril 18, 2006 at 5:32 PM

closed/rejected since it was correct behavior (the foreignkey were defined twice with a different name)

http://forum.hibernate.org/viewtopic.php?p=2301295#2301295

If the name had been the same an exception would have been thrown telling you that the foreignkey were already defined.

Rejected

Details

Assignee

Reporter

Bug Testcase Reminder (view)

Bug reports should generally be accompanied by a test case!

Bug Testcase Reminder (edit)

Bug reports should generally be accompanied by a test case!

Participants

Angela Stempfel
Max Rydahl Andersen

Community Help Wanted

Yes, please

Fix versions

Affects versions

Priority

Created April 18, 2006 at 12:33 PM
Updated April 18, 2006 at 5:32 PM
Resolved April 18, 2006 at 5:32 PM