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

The Archive Base Latest Questions

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

For some reason the following mapping seems to be creating me a very strange

  • 0

For some reason the following mapping seems to be creating me a very strange column name that I cant find anywhere. There error occures when trying to load the Events collection which is defined as a IList<Event>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="JeanieMaster.Domain.Entities" assembly="JeanieMaster.Domain">
  <class name="Location" table="Location" select-before-update="false" optimistic-lock="none">
    <id name="Id" column="LocationId" type="Int32">
      <generator class="identity"/>
    </id>
    <property name="CompanyName" type="String" />
    <property name="AddressLine1"  type="String" length="220" />
    <property name="AddressLine2"  type="String" length="220" />
    <property name="City" type="String" length="220" />
    <property name="Postcode" type="String" length="15" />
    <property name="County" type="String" length="220" />
    <property name="TelephoneNumber" type="String" length="25" />
    <property name="Latitude" type="Double" />
    <property name="Longitude" type="Double" />
    <property name="CreatedOn" type="DateTime" />
    <property name="ModifiedOn" type="DateTime" />

    <bag name="Events" table="VolatileEventContent" where="DeactivatedOn IS NULL" order-by="StartDate DESC" lazy="false" cascade="none">
      <key column="LocationId"/>
      <many-to-many class="Event"></many-to-many>
    </bag>
  </class>
</hibernate-mapping>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="JeanieMaster.Domain.Entities" assembly="JeanieMaster.Domain">
  <class name="Event" table="VolatileEventContent" select-before-update="false" optimistic-lock="none">
    <id name="Id" column="VolatileContentEventId" type="Int32">
      <generator class="identity"/>
    </id>

    <property name="Description" type="String" not-null="true" update="false" insert="false"/>

    <property name="StartDate" type="DateTime" not-null="true" />
    <property name="EndDate" type="DateTime" not-null="true" />

    <property name="CreatedOn" type="DateTime" not-null="true" />
    <property name="ModifiedOn" type="DateTime" />

    <many-to-one name="Location" class="Location" column="LocationId" />

    <bag name="Artists" table="EventArtiste" lazy="false" cascade="none">
      <key column="EventId"/>
      <many-to-many class="Artiste" column="ArtisteId" ></many-to-many>
    </bag>
  </class>
</hibernate-mapping>

The generated SQL is very strange as its self joining on a column “elt” which doesnt exist

SELECT          events0_.LocationId as LocationId__1_, 
                events0_.elt as elt1_, 
                event1_.VolatileContentEventId as Volatile1_12_0_, 
                event1_.Description as Descript2_12_0_, 
                event1_.StartDate as StartDate12_0_, 
                event1_.EndDate as EndDate12_0_, 
                event1_.CreatedOn as CreatedOn12_0_, 
                event1_.ModifiedOn as ModifiedOn12_0_, 
                event1_.LocationId as LocationId12_0_ 
FROM            VolatileEventContent events0_ 
left outer join VolatileEventContent event1_ 
on              events0_.elt=event1_.VolatileContentEventId 
WHERE           events0_.DeactivatedOn = NULL 
and             events0_.LocationId=184244 
ORDER BY        events0_.StartDate

This is my table definition:

CREATE TABLE [dbo].[VolatileEventContent](
    [VolatileEventContentId] [int] IDENTITY(1,1) NOT NULL,
    [LocationId] [int] NOT NULL,
    [CategoryId] [int] NULL,
    [ContentProviderId] [int] NOT NULL,
    [Description] [nvarchar](4000) NOT NULL,
    [StartDate] [datetime] NOT NULL,
    [EndDate] [datetime] NOT NULL,
    [CreatedOn] [datetime] NOT NULL,
    [ModifiedOn] [datetime] NULL,
    [DeactivatedOn] [datetime] NULL,
 CONSTRAINT [PK_VolatileEventContent] PRIMARY KEY CLUSTERED 
(
    [VolatileEventContentId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[VolatileEventContent]  WITH CHECK ADD  CONSTRAINT [FK_VolatileEventContent_ContentProvider] FOREIGN KEY([ContentProviderId])
REFERENCES [dbo].[ContentProvider] ([ContentProviderId])
GO

ALTER TABLE [dbo].[VolatileEventContent] CHECK CONSTRAINT [FK_VolatileEventContent_ContentProvider]
GO
  • 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:43:52+00:00Added an answer on May 13, 2026 at 8:43 pm

    Hmm strange I dont know why it was doing the above but I realised there was 2 things wrong with my hbm files

    1) VolatileContentEventId should have been VolatileEventContentId in the primary key declaration of the Event

    2) I have also added column=”VolatileEventContentId” to the key of the child event entity

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

Sidebar

Related Questions

This seems like a simple question, but for some reason I can't find the
For some reason the following doesn't crash like my program does, but I'm pretty
For some reason the following code doesn't work on Windows XP. new URL(file:// +
For some reason the following form isn't submitting the file like it should and
For some reason it looks like constructor delegation doesn't work in the following snippet:
For some reason, the following code never calls Event::Event(Event&& e) Event a; Event b;
I have a following program but for some reason it is throwing an error
For some reason, I am not entirely sure why, but the following is not
I'm new to Javascript and for some reason I can't get the following code
Following on from a previous question, for some reason when I use the following

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.