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 Guys, I need your help with a problem. I've created a repo project to make it easier to explain. As you can see in the Repo project. Basic Requirements is : Order & Receipt inherit from Transaction. OrderEntry & ReceiptEntry inherit from TransactionEntry. Order & Receipt has a One To Many Association to OrderEntry & ReceiptEntry objects. I don't want a OrderId and a ReceiptId in the TransactionEntry table just a TransactionId. Hope this is enough information for you to help me. PS: I've tried to set the ColumnName but then I get a Column TransactionId is mapped multiple times in entity TransactionEntry's inheritance hierarchy. Cheers |
|
|
Hi Johan, You wont be able to map this the way you have modelled it as you have found because LightSpeed is confused about TransactionId being mapped multiple times - this is not allowed. Instead I would drop the associations on the derived classes (Order -> OrderEntries, Receipt -> ReceiptEntries) as this is actually already reflected by the association on the base classes. If you want a strongly typed Order/Receipt from the entry side then you can set these up manually e.g.
|
|
|
Hi Jeremy, If I manually implement the associations in the class would this work? Johan |
|
|
No I wouldn't expect this to work. It might work in isolated cases but I would expect to see errors relating to the wrong value being assigned or a missing field on the model as we dont support having the same underlying column mapped to more than one property.
|
|