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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:25:10+00:00 2026-05-20T06:25:10+00:00

I think I’m misunderstanding something about how this works. This is my fluent mapping:

  • 0

I think I’m misunderstanding something about how this works. This is my fluent mapping:

public class FunctionInfoMap : ClassMap<FunctionInfo>
 {
  public FunctionInfoMap()
  {
   Id(x => x.Id);
   Map(x => x.Name);
   Map(x => x.Signature);
   Map(x => x.IsNative);
   Map(x => x.ClassId);
   References(x => x.Class, "ClassId");
   HasMany(x => x.CallsAsParent).Inverse();
   HasMany(x => x.CallsAsChild).Inverse();
   Table("Functions");
  }
 }

 public class CallMap : ClassMap<Call>
 {
  public CallMap()
  {
   CompositeId()
    .KeyProperty(x => x.ThreadId)
    .KeyProperty(x => x.ParentId)
    .KeyProperty(x => x.ChildId)
    .Mapped();
   Map(x => x.ThreadId).Index("Calls_ThreadIndex");
   Map(x => x.ParentId).Index("Calls_ParentIndex");
   Map(x => x.ChildId).Index("Calls_ChildIndex");
   Map(x => x.HitCount);
   References(x => x.Thread, "ThreadId");
   References(x => x.Parent, "ParentId");
   References(x => x.Child, "ChildId");
   Table("Calls");
  }
 }

 public class SampleMap : ClassMap<Sample>
 {
  public SampleMap()
  {
   CompositeId()
    .KeyProperty(x => x.ThreadId)
    .KeyProperty(x => x.FunctionId)
    .Mapped();
   Map(x => x.ThreadId);
   Map(x => x.FunctionId);
   Map(x => x.HitCount);
   References(x => x.Thread, "ThreadId");
   References(x => x.Function, "FunctionId");
   Table("Samples");
  }
 }

Now when I create this schema into a fresh database, that FunctionId field from SampleMap winds up in the Calls table.

create table Calls (
        ThreadId INTEGER not null,
       ParentId INTEGER not null,
       ChildId INTEGER not null,
       HitCount INTEGER,
       FunctionId INTEGER,
       primary key (ThreadId, ParentId, ChildId)
    )

create table Samples (
    ThreadId INTEGER not null,
   FunctionId INTEGER not null,
   HitCount INTEGER,
   FunctionId INTEGER,
   primary key (ThreadId, FunctionId)
)

I don’t understand why it’s there, since it should only exist in the Samples table.

  • 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-20T06:25:10+00:00Added an answer on May 20, 2026 at 6:25 am

    I finally figured out the problem, more or less. The pair of collections on FunctionInfoMap were confusing NHibernate, since they don’t actually lead anywhere. Adding KeyColumn entries to link them up to the Parent and Child associations corrected the stray field.

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

Sidebar

Related Questions

I think that I am misunderstanding something about how jquery $(this) works. In my
Think about a table like this ID Value 100 1 100 3 101 1
think about an array like this: ... key1 => some_call(val1, $params), key2 => some_call(val1,
think about this: StreamReader reader = null; try { reader = new StreamReader(_fileName); }
I think I must be missing something obvious, but I'm unable to find this
Think about the following: Your ISP offers you a dynamic ip-address (for example 123.123.123.123).
Think: tiling my emacs window with eshells, a la xmonad. Is this possible? I
I think I got all the steps down but I must be missing something
I think this problem is related to this question: Clicking submit clears file field
I think this is a reasonably easy question however I just don't get autoloading

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.