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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:35:32+00:00 2026-06-09T15:35:32+00:00

I am trying to turn this sql statement into a fluent nhibernate mapping :

  • 0

I am trying to turn this sql statement into a fluent nhibernate mapping :

select *
from Project p
inner join ProjectData pd on p.Project = pd.Project
inner join ProjectCompany pc on p.Project = pc.Project and pc.InitComp = 'Yes' and pc.Company = pd.LogComp
inner join ProjectCustomer cust on cust.id = pd.custid

I’m facing a number of problems for getting this statement into a single entity(all joins are a 1 on 1 relationship).
I am aware that a single view would solve my issues but alas i don’t have the privileges to create one.

Currently my code looks like this

Table("Project");
Id(p=> p.Number);
Join("ProjectData", j =>
{
    j.Fetch.Join();
    j.KeyColumn("Project");
    j.Map(pd => pd.Customer);
});
Map(p => p.Complexity);

The problems i am facing are :

  • How do i create a hard coded filter (pc.InitComp = ‘Yes’)
  • How do i join with 2 statements(p.project = pc.Project and pc.Company = pd.LogComp
  • How do i join from a joined table rather then the base one?(ProjectCustomer joins on ProjectData)

A lot of questions for something so trivial in sql but i can’t seem to find a simple answer on the internet other then create a view.

  • 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-06-09T15:35:34+00:00Added an answer on June 9, 2026 at 3:35 pm

    I ended up with a raw sql query and using a datareader to manually fill my object.
    This worked cause i only needed to read from a table and not write.

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

Sidebar

Related Questions

I'm trying to turn this XML string into a select I have @Schedule XML
Trying to turn this: href=/wp-content/themes/tray/img/celebrity_photos/photo.jpg into: href=/img/celebrity_photos/photo.jpg So I'm simply trying to remove /wp-content/themes/tray/
I am trying to execute this code in C#.NET to turn an SQL table
im trying to turn this jquery script into a toggle event type, thier is
Ok I am having a small issue I am trying to turn this jQuery
I'm trying to figure out how to turn this object and use it for
I'm trying to turn my data into a burndown chart to monitor the progress
So i'm trying to turn a bunch of from x import x statements, that
I am trying to turn specific words or phrases into links with jQuery. So
I'm trying to insert into XML column (SQL SERVER 2008 R2), but the server's

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.