I get this error during schema generation TODAY. When searching in google, I found an old AndroMDA/Hibernate Cartridge issue dated 3/05:
------------------ START OF QUOTE --------------- The bug results in errors of this ilk during schema-export: Foreign key (SEE_ALSO [SEE_ALSO_FK,BIBLIOGRAPHIC_REFERENCES_FK])) must have same number of columns as the referenced primary key (BIBLIOGRAPHIC_REFERENCE [ID]) ------------------ END OF QUOTE ------------------- Which was supposed to have been fixed by Wouter saying: ---------------- START OF QUOTE --------------------- Comment by Wouter Zoons [28/Mar/05 10:10 PM] [ Permlink ] In particular it appears to affect all many-to-many self-associations, of which we have a few, nothing special about them - navigable in only one direction. We were getting mapping code that looked like this (sorry if this is confusing): <set name="seeAlso" table="SEE_ALSO" order-by="SEE_ALSO_FK" outer-join="auto" lazy="true" inverse="false"> <key foreign-key="BIBLIOGRAPHIC_REFERENCE_SEE_ALSO_FKC"> <column name="BIBLIOGRAPHIC_REFERENCES_FK"/> </key> <many-to-many class="edu.columbia.gemma.common.description.BibliographicReferenceImpl" column="SEE_ALSO_FK" foreign-key="BIBLIOGRAPHIC_REFERENCE_SEE_ALSO_FKC"/> </set> I think BIBLIOGRAPHIC_REFERENCE_SEE_ALSO_FKC should not be used twice? I see you changed it from 'sourceEnd' to 'otherEnd' in the first instance. The SEE_ALSO table ends up with two foreign key constraints with the same name. -------------------- END OF QUOTE ------------------------ If it was fixed, why then I am getting teh error again. It seems to be related to relationship (association) ends naming. Although the role names at the end of associations between two entties are unique, that still is not sufficient to prevent this error if one of the entities involved has associations with a third entities and there roles with the same names. Any idea about this problem and how to deal with it from a MODELING perspective? Regards Safaa _________________________________________________________ Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=3783#3783 Posting to http://forum.andromda.org/ is preferred over posting to the mailing list! ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Andromda-user mailing list Andromda-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/andromda-user