0

User is an entity and Address is a component. One User can have one Address.

Address cannot live outside user object. So if user is deleted I want to delete and Address object as well.

Is this Cascade.DeleteOrphan? and if it is how to set it using mapping by code in nhibernate.

user1765862
  • 13,635
  • 28
  • 115
  • 220

1 Answers1

1

Yes, you should use cascading. Take a look at the documentation for more details.

tucaz
  • 6,524
  • 6
  • 37
  • 60