Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8427425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:46:46+00:00 2026-06-10T04:46:46+00:00

I am working on MVC app with NHibernate. I am having a screen with

  • 0

I am working on MVC app with NHibernate. I am having a screen with Customer information and Order objects. As guessed, customer entity is having List property and Order entity is having customer property.

I attached the orders object by storing them in session. User can add/delete the orders, so I have attached modified orders to the customer object. But when I see the sql statements, it is inserting the new orders which is expected behavior but for deleted orders it is updating with customer_id = null instead of deleting them completely?

Thanks,
Sundeep

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:46:47+00:00Added an answer on June 10, 2026 at 4:46 am

    you’re looking for cascade options.
    The reason your orders were being erased is that you persisted an empty collection, so nHibernate assumed that the collection was emptied on purpose, and updated that collection items in the Db by removing the associations.

    The behavior that you most probably want is AllDeleteOrphan which would delete orders removed from your customer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an MVC app in Sencha Touch 2 and am having
I'm currently working on a reasonably simple MVC app which allows the user to
I am working on an existing ASP.NET MVC app that started small and has
I'm working on a MVC based web app on LAMP that needs some records
I'm converting a legacy webforms app to MVC, working through it a page at
I'm working on a PHP web app and I'm trying to use the MVC
I am working on mvc project, with repository pattern and entity framework, now on
I'm working on an MVC app that makes heavy use of Services. My question
I am working a mvc web app. I upload a image to use it
I'm working on an MVC 3 app in .NET, I don't have much experience

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.