I am trying to understand your model

You have two relations from host to sequence:

Host -> Sequence (Host.Sequence) [many-to-one]
Sequence -> Host (Host.Sequences) [


1. I expect it to work correctly when you remove the property and mapping
for Host.Sequence.

2. Your problem seems that you have multiple properties sharing the same
child entity Sequence.

What is your requirement for this model as it seemes a bit flawed for an
aggregate?

I have created a similar model once but there the child entity was not part
of the aggrete. There I had this:

Language
Document.Languages
Document.DefaultLanguage

This required the language entity to be managed apart from the document. My
guess is that you are in the same situation.


Would the following work?

var host = new Host();
var sequence = new Sequence();

host.Sequence = sequence;
host.SequencesAdd(sequence);

session.Save(sequence);
session.Save(host);


var host = session.Get<Host>(id);
var sequence = host.Sequence;
host.SequenceRemove();
host.Sequence = null;

session.Delete(sequence);

-- 
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