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
|
So I've got a classic self-referencing "Org" table. Org has a nullable parentId that points back to the org table. Org also has soft deletes set up and I want these to cascade if the parent is deleted. Based on what I've read, I set up the relationship mapping on the designer as: IsDependent: True IsNullable: True Removal Behavior: NoActionNoCheck The problem I run into is that I get the following error when I do this: Mindscape.LightSpeed.LightSpeedException : The field [ParentId] on type [Org] must be nullable as it represents a hierachical relation But as you can see above it is clearly marked as nullable, and when I look at the generated class, the ParentId is in fact nullable: [DependentAttribute(ValidatePresence=false)] private System.Nullable[long] _parentId; If I set IsDependent = False, the error goes away but I get no cascading deletes. I could add these manually in the OnEnlisted, but I was under the iimpression that LS would handle this for me. Any ideas? |
|
|
Sorry this isn't supported for hierarchical relationships so you will need to cater for it manually in this case.
|
|
|
Hi Jeremy, I have exactly the same issue, but the difference is that I do not use soft deletion. The association is set to nullable, Is Dependent is set to false Removal Behavior is set to NoActionNoCheck Soft deletion is off. Yet I still can use it as I get the exception: The field xyz on type abc must be nullable as it represents a hierachical relation. Any ideas? |
|
|
Can you post your model for the entity and the self-association as we must be detecting this association as needing to cascade (which is where the exception is triggered).
|
|