Hi there,

here is my scenario (a sort of a graph):

interface INode
{
    IEnumerable<INode> Children { get; }
}
class Leave : INode {
    Guid Id { ... }
    IEnumerable<INode> Children { get; } //always empty
}

class Node : INode {
    Guid Id { ... }
    IEnumerable<INode> Children { get; } //can contain Leave and Node
}

I mapped this stuff using an any-type mapping in a many-to-many relation

<class name="Node" ...>
...
<bag name="Children" table="Node_Children">
      <key column="NodeId"/>
      <many-to-any id-type="Guid" meta-type="System.String">
        <meta-value value="NODE" class="Node"/>
        <meta-value value="LEAVE" class="Leave"/>
        <column name="ItemType" not-null="true"/>
        <column name="ItemId" not-null="true"/>
      </many-to-any>
    </bag>
</class>

but I have a problem: let's suppose I delete a Leave/Node: how can I
propagate this deletion to all the involved Node_Children rows?
Is it possible? Or shall I use a workaround? (i.e. a trigger on
deletion... but I'd really prefer to avoid :-)).

Thanks in advance,
Giulio

--

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to