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 435013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:19:59+00:00 2026-05-12T20:19:59+00:00

I have a hierarchy of tables 3 levels deep (QualificaionType has many QualificationGroups, which

  • 0

I have a hierarchy of tables 3 levels deep (QualificaionType has many QualificationGroups, which have many Qualifications) mapped like this:

// QualificationType
HasMany(x => x.QualificationGroups)
    .Inverse()
    .KeyColumns.Add("QualificationGroupId")
    .AsBag()
    .Cascade.AllDeleteOrphan()
    .Access.CamelCaseField(Prefix.Underscore);

// Qualification Group
HasMany(x => x.Qualifications)
    .Inverse()
    .KeyColumns.Add("QualificationId")
    .AsBag()
    .Cascade.AllDeleteOrphan()
    .Access.CamelCaseField(Prefix.Underscore);

When I delete a Qualification Group, it deletes all qualifications related to it. But when I try to delete a Qualification Type, it tries to delete all related Qualification Groups but not their Qualifications.

How can I get it to cascade all the way down so that if I delete a Type, it deletes all the Groups and all of their Qualifications? Do I need to loop through all the Groups first and delete them? It seems this should be able to be handled through mappings alone.

FYI, I’m using Fluent NHibernate 1.0RTM and NHibernate 2.1

  • 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-05-12T20:19:59+00:00Added an answer on May 12, 2026 at 8:19 pm

    I figured it out… mappings were incorrect.

    They should be this:

    // QualificationType
    HasMany(x => x.QualificationGroups)
        .Inverse()
        .KeyColumn("QualificationTypeId")
        .AsBag()
        .Cascade.AllDeleteOrphan()
        .Access.CamelCaseField(Prefix.Underscore);
    
    // Qualification Group
    HasMany(x => x.Qualifications)
        .Inverse()
        .KeyColumn("QualificationGroupId")
        .AsBag()
        .Cascade.AllDeleteOrphan()
        .Access.CamelCaseField(Prefix.Underscore);
    

    I had the wrong key column in each.

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

Sidebar

Related Questions

Lets say I have hierarchy like this (This is just a test program. Please
Say I have a schema that represents a fixed-depth hierarchy like this: CREATE TABLE
I have a MySQL database set-up in a hierarchy style. There are 4 tables
I have a hierarchy of model objects which I will be displaying on different
I have an hierarchy of classes that looks like the following: class Critical {
I have a hierarchy of objects that I would like to show using a
I have a table containing hierarchical data. There are currently ~8 levels in this
I have a self referential table, which has ID, ParentID (nullable). So, the table
I have an object Topic which is a self-related hierarchy where the child Topics
Using Hierarchy data type on SQL 2008. Nodes in my hierarchy go like this:

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.