Discussion:
[Middlegen-user] middlegen generates loop relationship description by error
Thomas Finneid
2007-01-25 14:31:15 UTC
Permalink
Hi

I am working on a project where we use middlegen to generate the
hibernate objects based on an existing DB2 database. But we experience
an error in the generation occurs.

For two tables ORG_UNIT and LEVEL there are two 1-M relationships from
ORG_UNIT to LEVEL named:

org_unit_id1 and
org_unit_id2

they represent an organisational hierarchy, which can be traversed.

The problem is that middlegen does not name this as two simple 1-M
relationships. So instead of generating this

relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1.T_LEVEL-has-T_ORG_UNITByOrgUnitId1.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1.T_LEVEL-has-T_ORG_UNITByOrgUnitId1.target-many=false
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1.T_ORG_UNIT-has-T_LEVELByOrgUnitId1.enabled=tru
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1.T_ORG_UNIT-has-T_LEVELByOrgUnitId1.target-many=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2.T_LEVEL-has-T_ORG_UNITByOrgUnitId2.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2.T_LEVEL-has-T_ORG_UNITByOrgUnitId2.target-many=false
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2.T_ORG_UNIT-has-T_LEVELByOrgUnitId2.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2.T_ORG_UNIT-has-T_LEVELByOrgUnitId2.target-many=true


it generates this

relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1.T_LEVEL-has-T_ORG_UNITByOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1.T_LEVEL-has-T_ORG_UNITByOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1.target-many=false
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1.T_ORG_UNIT-has-T_LEVELByOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1-org_unit_id_1.T_ORG_UNIT-has-T_LEVELByOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1AndOrgUnitId1.target-many=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2.T_LEVEL-has-T_ORG_UNITByOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2.T_LEVEL-has-T_ORG_UNITByOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2.target-many=false
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2.T_ORG_UNIT-has-T_LEVELByOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2.enabled=true
relations.T_ORG_UNIT-T_LEVEL-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2-org_unit_id_2.T_ORG_UNIT-has-T_LEVELByOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2AndOrgUnitId2.target-many=true




Does anybody have any suggestion on how to fix this kind of problems?

thomas

Loading...