This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have the following requirement: An AddIn has one "Picture" as "GalleryPicture" and many others as "Screenshots". The references from the Picture to the add in are both named by the designer "Addin". Sure two properties with the same name are not allowed. So I renamed it "AddInForThisGalleryPicture" and "AddInForThisScreenShot" - now I get a "Circular associations are not supported by LightSpeed: [Picture.AddInForThisScreenshot and AddIn.AddInGalleryPicture]" exception. How do I need to design such a situation?
Regards, Sörnt |
|
|
Reverse the one-to-one association. The 'circular association' error comes up when A has a foreign key to B and B has a foreign key to A (because this would mean B has to be inserted before A, but A has to be inserted before B). In your case, of course, Picture has a foreign key, AddInForThisScreenshotId, to AddIn. Now the current direction of the one-to-one association means it is implemented as a foreign key, GalleryPictureId, from AddIn to Picture, causing the error. But if you draw the one-to-one association in the other direction, then it will be implemented as a foreign key from Picture to AddIn instead, thus getting rid of the circular association (because now both FKs will be on Picture). |
|
|
Thanks - works like a charm :-) |
|