Fluent NHibernate one-to-one doesn't have cascade all-delete-orphan

后端 未结 3 935
挽巷
挽巷 2020-12-21 04:48

I am in the process of updating the existing *.hbm.xml files into fluent ClassMaps and have stumbled on a mistake in our mapping files, and I don\'t know the default behavio

3条回答
  •  青春惊慌失措
    2020-12-21 05:35

    In the end, I just needed to figure out what was wrong and fix this, regardless of the default fluent behavior. With the help of http://brunoreis.com/tech/fluent-nhibernate-hasone-how-implement-one-to-one-relationship/ I was able to solve this issue.

    I needed to add .Cascade.All(). However, what I really needed was a .ForeignKey() off the HasOne relationship in my mapping for the LineItemAssembly class.

提交回复
热议问题