opensubscriber
   Find in this group all groups
 
Unknown more information…

m : middlegen-user@lists.sourceforge.net 25 January 2007 • 10:31PM -0500

[Middlegen-user] middlegen generates loop relationship description by error
by Thomas Finneid

REPLY TO AUTHOR
 
REPLY TO GROUP






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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
middlegen-user mailing list
middlegen-user@list...
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.