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, Trying to get up to speed on Lightspeed. I have a table Content and a table Tag. Each has an int primary ID. I have a table ContentTag with fields ContentId and TagId and a composite key comprised of both of these fields. I can't work out how to setup the through association with this. The designer creates the ContentTagID but I get an error that says: Unable to materialize field [ContentId] on type [XpoVsEntitySpaces.ContentTag]. Check your table has an Id column and that your mappings are correct. See inner exception for details. Do you have an example that shows a many to many fully implemented? John |
|
|
Hi John, We only recently added composite key capabilities to LightSpeed 3.0. I was not the developer who built that feature and he may be able to add additional assistance to this thread later however I do not believe LightSpeed currently supports just a composite key for a through association join table currently. You will still need to have an Id field, and then a foreign key field for each of the two associated entities. So you will have: Id [PK] I appreciate your feedback though and will take it into account for future improvements to LightSpeed. I hope that helps, John-Daniel Trask P.S. I do like that the type in question is XpoVsEntitySpaces! :-D |
|
|
OK, Thanks. I'll give that a shot. LOL about the type - I meant to edit that out. I'm trying out different ORMS (well beyond those two now :) John |
|
|
OK, That did work. But I noticed something in setting up the throughAssociation - it does not seem to trigger the lazy loading. If I used the regular collection (ContentTags.Tag) it got lazy loaded fine. If I try to use the TA, it is not lazy loaded and the TA only works if I enable EagerLoad on that collection in the designer. Any way to have it trigger the lazy load as well?
John |
|
|
Let me know how you get on John :-) Keep in mind the support provided by the vendors with your comparison ;-) Kind regards, John-Daniel Trask |
|
|
Hmm... That doesn't sound right - at least you shouldn't have to enable eager loading in the designer to get a through association to work. Here is a post from recent times about lazy loading through associations: http://www.mindscape.co.nz/forums/Thread.aspx?PostID=4091 There is also a much older post that has some back story, which may or may not be of interest to you: http://www.mindscape.co.nz/forums/Thread.aspx?PostID=2502 I hope that helps, let me know how you get on, John-Daniel Trask |
|