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.

3
  • By mapping by code you mean fluent-nhibernate? Commented Feb 19, 2013 at 12:54
  • Maybe this can be of some help stackoverflow.com/q/9573326/1236044 Commented Feb 19, 2013 at 12:59
  • @agustingMeriles no, not fluent. I mean mapping by code approach Commented Feb 19, 2013 at 13:08

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.