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
|
Normal 0 false false false EN-NZ X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} I have an old database (pre 95, now in sql server from access via paradox) . It was originally designed by a noob with no db experience (damn access) then modified by another noob (me) and then butchered by a "didn't think he was a noob but he was". One of the resultant idiosyncrasies is that the main table ("Claims") has 2 unique indexes, the PK int ClaimId and the previous PK string Claim. New related tables all use the ClaimId in relationships. Older tables however use the Claim field instead. Don’t ask about intermediate tables. So is there any way I can add a 1-many link between the Claims table and another using the non PK field Claim? I can’t see any (sane) way to do it myself but I may be missing something.
|
|
|
I'm afraid this isn't possible in current versions of LightSpeed. We have a long-standing backlog item for using unique keys instead of IDs in associations, but we haven't yet been able to implement it. You can almost do it using custom association resolvers, but there seems to be an issue with the way we wire up entities during a collection load that's stopping it working at the moment. I can look into this if it is a must-have feature, but I can't promise it will work even if I can fix that -- plus there are some limitations around the use of custom association resolvers, e.g. with cascade deletes. You may be better off just writing helper methods e.g. partial class Claim { Obviously you don't get all the automatic association management but at least it should work, which as I said I can't guarantee for the custom resolver approach. |
|
|
OK. Werll I can work around it, but consider this another vote for the feature. |
|