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 two entities Product and MSDSData with a one-to-one association. The primary key is also the foreign key, such that Product.Id = MSDSData.Id. The products table is part of the legacy application (which we cannot modify) so the MSDSData table was added to the db to hold additional product information. I'm adding a custom AssociationResolver to resolve this unconventional db design. I'm adding it directly to the code generated by the designer (I know, at risk of losing my code if I modify the .lsmodel file). Here's the code generated by the designer:
This code seems to work fine and instances of either class are hydrated properly as long as I do not attempt to traverse the relationship (in which case it says it cannot find the fields in the db). To this existing code I added the custom AssociationResolver so the code now looks like:
When I run the code with the custom AssociationReolver's declared above I get the following error:
Yet again if comment out the two lines below the code runs fine:
Can someone please help.. I don't understand what I'm doing incorrectly. I've used AssociationResolver's else where without a problem but here it doesn't seem to be working. Thanks in advance. |
|
|
Okay seems I answered my own question. Refer to this previous post: http://www.mindscapehq.com/forums/thread/4134 The problem seems to be LS does not support custom AssociationResolvers on one-to-one associations - only supported on one to many. So for now, I've had to implement this as a one-to-many and it works fine. The response from the link above was that the one-to-one association support is on the wish list.. any chance we can get this? Thanks |
|
|
Hi SR8, We'll try to bump it up the priority list but I can't make any promises -- sorry! |
|