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

  • Home
  • SEARCH
  • 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 8069975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:14:35+00:00 2026-06-05T13:14:35+00:00

I am getting an exception when deleting an object using fluent nhibernate table inheritance.

  • 0

I am getting an exception when deleting an object using fluent nhibernate table inheritance.

I can’t figure out what is incorrect with my application structure and mappings, and why it is looking for a many-to-many mapping table when I am using table inheritence?

Adding and updating works fine.

I have not set any mappings explicitly, I am using the default fluent nhibernate mappings.

For the exception of an override to handle my cascades shown below:

public class CascadeAll : IHasOneConvention, IHasManyConvention, IReferenceConvention
{
    public void Apply(IOneToOneInstance instance)
    {
        instance.Cascade.All();
    }

    public void Apply(IOneToManyCollectionInstance instance)
    {
        instance.Cascade.All();
    }

    public void Apply(IManyToOneInstance instance)
    {
        instance.Cascade.All();
    }
} 

The exception is:

Invalid object name 'BlogPageToPage'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'BlogPageToPage'.

My database looks like this.

Page
    Id (Guid)  
    Name  
    etc. 

BlogPage  
    Page_Id (Guid, exact same as parent page)  
   etc.

Classes:

public class Page : EntityBase 
{
    public Page()
    { 
        BlogPages = new List<BlogPage>(); 
    }

    public virtual IList<BlogPage> BlogPages { get; set; } 

}


public class BlogPage : Page
{
    public BlogPage()
    { 
    }

    public virtual IList<Post> Posts { get; set; } 
}

My delete looks like this:

 public bool Delete(T model)
    {
        Session.Delete(model);
        return true;
    }

Thanks for your input.

  • 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-05T13:14:36+00:00Added an answer on June 5, 2026 at 1:14 pm

    Of course I am being an idiot.

    The reason it is looking for that table is because I have the BlogPages as a List on the Page object which is the parent.

    So when I try delete it, it simply thinks there should be another table there to match that association.

    Offending line:

        public virtual IList<BlogPage> BlogPages { get; set; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting exception by deleting a row from the table view. - (NSInteger)numberOfSectionsInTableView:(UITableView
On my Arch Linux, Eclipse with Google Window Builder/SWT application, I am getting Exception
I am using Hibernate and getting Exception in thread main org.hibernate.ObjectNotFoundException: No row with
What is the best practice way of getting Exception Transparency in Java when using
I m getting exception as follow. Can anybody help me? 06-16 11:32:48.237: ERROR/AndroidRuntime(9223): java.lang.IllegalStateException:
Getting exception "The property value is larger than allowed by the Table Service" while
i am getting exception while the server starts. (Server is started using Intelij IDE).
I have some problems with deleting object. I am getting the following error: [Test.Item#ab9a9869-b2c1-4262-8d33-9dd9010abd96][SQL:
I'm getting exception An object reference is required for the non-static field, method, or
m getting exception while taping on listView item.. @Override protected void onCreate(Bundle savedInstanceState) {

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.