I have a situation where I have two entities that share a primary key (Transaction and TransactionDetail). I have them mapped using many-to-one relationship from Transaction to TransactionDetail and from TransactionDetail to Transaction. Transaction detail holds one record for each transaction.
However, when I create a new transaction detail object and add it to the transaction, NHibernate tries to update the Transaction table with a query like 'update transaction set id = ? where id = ?' with the same value for each parameter.
Since the mapping is on the primary key column, I don't want the transaction to be updated. In fact, since the primary key is an identity column, I get an error when it tries to update the value. How can I prevent NHibernate from updating the Transaction table when a new TransactionDetail record is created?