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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:06:00+00:00 2026-05-16T14:06:00+00:00

I am having trouble using CreateCriteria to add an outer join to a criteria

  • 0

I am having trouble using CreateCriteria to add an outer join to a criteria query while using Fluent NHibernate with automapping.

Here are my entities –

public class Table1 : Entity
    {
        virtual public int tb1_id { get; set; }
        virtual public DateTime tb1_date_filed { get; set; }
    .
    .
    .
        virtual public IList<Table2> table2 { get; set; }
    }

public class Table2: Entity
    {
        public virtual int tb2_id { get; set; }
        public virtual int tb2_seqno { get; set; }
        .
        .
        .
        public virtual Table2 table2 { get; set; }
    }

I try to use the following to add an outer join to my criteria query –

CreateCriteria("Table2", NHibernate.SqlCommand.JoinType.LeftOuterJoin);

But I am getting an error –

{"EIX000: (-217) Column (tbl1_id) not found in any table in the query (or SLV is undefined)."}

So it seems that it is trying to automatically set the id of the second table, but doesn’t know what to set it to. Is there a way that I can specifically set the id? Here is my Session –

var persistenceModel = AutoMap.AssemblyOf<Table1>()
                .Override<Table1>(c => {    
                    c.Table("case");
                    c.Id(x => x.id).Column("tbl1_id");
                })
                .Where(t => t.Namespace == "MyProject.Data.Entities")
                .IgnoreBase<Entity>();

Hope that makes some sense. Thanks for any thoughts.

  • 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-16T14:06:01+00:00Added an answer on May 16, 2026 at 2:06 pm

    I added a HasMany option to the override for my first table to define the relationship to my second table. I then added an override for my second table which defines the id column for that table.

    Thank

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

Sidebar

Related Questions

I have a SQL query I'm having trouble creating using NHibernate Criteria: SELECT ID,
I am using mssql and am having trouble using a subquery. The real query
I am using NHibernate and Rhinomocks and having trouble testing what I want. I
I am having trouble using the link_to_remote method while rendering a layout. For example
Im having trouble using a .NET COM in vb6, It compiles ok and I
I am having trouble using the attribute XPath Selector in ElementTree, which I should
I'm having trouble using the flowlayoutPanel in a C# winform application. What I basically
I'm new to development using Xcode, and am having trouble using the built-in Leaks
I'm having trouble reading a chunked response when using a StreamReader to read the
I'm having trouble with redirecting urls using the .htaccess file. This is what my

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.