I have managed to work out was i was doing wrong.
The documentation for One-to-many associations states:
Quote:
Very Important Note: If the <key> column of a <one-to-many> association is declared NOT NULL, NHibernate
may cause constraint violations when it creates or updates the association.
My problem was that i had set the key column to be NOT NULL.
Setting the column to be NULLABLE it worked perfectly.
I presume that does some insert and then updates it straight away.
NB: The documentation also recomends using a bidirectional association but i do belive you can only use a set or bag collection, which you can't use the <index> attribute.