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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:17:14+00:00 2026-05-22T17:17:14+00:00

I have mapped a class hierarchy using a table per subclass and it works

  • 0

I have mapped a class hierarchy using a table per subclass and it
works with Sql Server 2005.

However, when I try to use this same mapping against a Sql Compact 4.0
db, the generated insert statement is not working because it does not
include any column or value.

I’m using NH3.1.0-GA and MsSqlCe40Dialect.

The insert statement generated is:

INSERT INTO Element values ( )

And the mapping:

<class name="IElement" table ="Element">
    <id name="Id">
        <generator class="identity"/>
    </id>

    <joined-subclass name="TextElement" table ="TextElement">
        <key column="Id"/>
        <property name="Text" length="200"/>
    </joined-subclass>

    <joined-subclass name="NumberElement" table="NumberElement">
        <key column="Id"/>
        <property name="Value"/>
    </joined-subclass>

</class>

Thanks.

  • 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-22T17:17:15+00:00Added an answer on May 22, 2026 at 5:17 pm

    That’s definitely a bug (more precisely, a yet-unsupported scenario). I suggest you create an issue with a full repro test at http://jira.nhforge.org (you can link to this question)

    The MSSQL syntax for a value-less insert is INSERT INTO <table> DEFAULT VALUES. This is defined in MsSql2000Dialect.NoColumnsInsertString.

    The same code should probably be applied to MsSqlCe40Dialect (or MsSqlCeDialect if this syntax was available in previous versions, which I don’t know).

    As a workaround, just inherit from MsSqlCe40Dialect and add the following:

    public override string NoColumnsInsertString
    {
        get { return "DEFAULT VALUES"; }
    }
    

    Of course, I’m assuming that is the correct syntax for SQL CE 4.

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

Sidebar

Related Questions

I have a class that is mapped to a table using NHibernate. The problem
I have a nvarchar(2000) column in a SQL Server 2005 database, and have mapped
I have a class mapped with a table, in my case in a declarative
I have the following class structure FlowerDAO with the fields (mapped using Hibernate): id
I have the following Hibernate Mapping, which has to be mapped using the Table
I have a class hierarchy mapped with InheritanceType.JOINED in Hibernate (3.5.6 final) with JPA
I have mapped my inheritance hierarchy in Hibernate using InheritanceType.Single_Table and discriminator columns to
I have designed a hierarchy, every class has 2 readonly properties mapped to 2
For example I have one class mapped to a table in first database and
I have question regarding the SQLAlchemy. How can I add into my mapped class

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.