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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:13:18+00:00 2026-05-13T20:13:18+00:00

I have a table like: CREATE TABLE [dbo].[MOVIES_HISTORY]( [DATE] [datetime] NOT NULL, [COUNT] [int]

  • 0

I have a table like:

CREATE TABLE [dbo].[MOVIES_HISTORY](
 [DATE] [datetime] NOT NULL,
 [COUNT] [int] NOT NULL CONSTRAINT [DF_MOVIES_HISTORY_COUNT]  DEFAULT ((0)),
 CONSTRAINT [PK_MOVIES_HISTORY] PRIMARY KEY CLUSTERED 
(
 [DATE] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

Class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Kinoplex.Models
{
    public class MoviesHistory
    {
        private DateTime date;
        private int count;

        public DateTime Date
        {
            get
            {
                return date;
            }
            set
            {
                date = value;
            }
        }

        public int Count
        {
            get
            {
                return count;
            }
            set
            {
                count = value;
            }
        }
    }
}

Mapping file:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   namespace="Kinoplex.Models"
                   assembly="Kinoplex">

  <class name="MoviesHistory"
         dynamic-insert="true"
         dynamic-update="true"
         lazy="false"
         table="MOVIES_HISTORY">


    <id name ="Date" column="DATE" type="datetime">
    </id>

    <property name ="Count" >
      <column name="COUNT" sql-type="int" not-null="true"></column>
    </property>



  </class>
</hibernate-mapping>

Every other class is working, I only have problem with this one.

Executing query like:

IQuery query = this.session.CreateQuery("from MoviesHistory");

results in an exception:

MoviesHistory is not mapped [from MoviesHistory]

Anyone can tell me what is wrong? I suspect that id column might be wrong, but can’t find anything about that.

  • 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-13T20:13:18+00:00Added an answer on May 13, 2026 at 8:13 pm

    Make sure your .hbm.xml has it’s build action set to Embedded Resource in your project, otherwise it won’t be included in the mappings as nHibernate starts up.

    Also, not positive it matters, but DateTime should have proper casing to be safe (not sure if the nHibernate parser cares anymore, it didn’t at one point):

    <id name="Date" column="DATE" type="DateTime">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Created a table like CREATE TABLE [dbo].[tab1]( [Id] [int] NOT NULL, [Name]
I have a table like so.. CREATE TABLE [dbo].[Locations_Hours]( [LocationID] [int] NOT NULL, [sun_open]
I have a table that looks like this: CREATE TABLE [dbo].[SomeTable]( [Guid] [uniqueidentifier] NOT
If I have a table like: CREATE TABLE FRED ( recordId number(18) primary key,
If I have a table like this: CREATE TABLE sizes ( name ENUM('small', 'medium',
Let's say I have a payments table like so: CREATE TABLE Payments ( PaymentID
I have a SQL Server 2005 table like this: create table Taxonomy( CategoryId integer
I have a table in PostgreSQL where the schema looks like this: CREATE TABLE
I have a table like as follows: SoftwareName Count Country Project 15 Canada Visio
Let's say my table structure looks something like this: CREATE TABLE [dbo].[table1] ( [id]

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.