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
|
Hello, When I try adding one-to-many relationships in my model designer, the designer is generating some of my model properties again (the field that is being referenced for the relationship), resulting in a "Model X already contains a definition for <Property>" I am using Lightspeed with MySql. Any suggestions?
|
|
|
I'd guess that you've dragged on tables that don't have foreign keys defined on them -- e.g. a Child table that has a ParentId column, but ParentId is not marked as a foreign key. So LightSpeed has interpreted ParentId as a normal scalar property rather than an association. (If ParentId were a FK, LightSpeed should infer the association for you.) When you add the association by hand, that results in both a Parent entity reference and a ParentId foreign key property being generated. I.e. the explicit ParentId property is now redundant: it's subsumed into the association. So just delete the explicit ParentId property out of the entity and you should be good to go. (You may need to check column mappings e.g. if the underlying column for the explicit ParentId property was called PARENT_ID or something like that then you'll need to set the Backreference Id Column Name.) |
|