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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:49:31+00:00 2026-05-24T02:49:31+00:00

I am working on converting an old app written in powerbuilder to a .NET

  • 0

I am working on converting an old app written in powerbuilder to a .NET app. In this process we work with an old database, and some of the queries used in the powerbuilder app is quite challenging to convert into nhibernate fluent mapping (for me at least).

I have the following sql to get a list of bits:

SELECT   MYSCHEME.BIT.BIT_S,
         MYSCHEME.BIT.BIT_NAME,
         MYSCHEME.BIT.BIT_TYPE,   
         MYSCHEME.BIT.BIT_SIZE,                     
         MYSCHEME.BS.BS_NAME,    
         MYSCHEME.CMS.WHOLE_S

FROM MYSCHEME.BIT join MYSCHEME.BS on ( MYSCHEME.BIT.BS_S = MYSCHEME.BS.BS_S ) 
left outer join MYSCHEME.OF on MYSCHEME.BIT.BIT_TYPE_S = MYSCHEME.OF.F_S 
left outer join MYSCHEME.CMS on MYSCHEME.OF.OF_S = MYSCHEME.CMS.PART_S
WHERE ( MYSCHEME.BS.BS_S = 25) 

How should i map this into nhibernate? Should i use criteria and joins, or just map it with references to other tables? An other challenge is that there are very few key constrains in the database, for example there is no key constraint between BIT and OF, or CMS and OF.

Anyone has a good idea of how to solve this challenge? I must also be able to update CMS.WHOLE_S.

The first join to the BS table is not very important, since it is only to get the “parent” information, i can access that information from other parts in my application.

  • 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-24T02:49:31+00:00Added an answer on May 24, 2026 at 2:49 am
    class Bit
    {
        public virtual BS Bs { get; set; }
        public virtual int WholeS
        {
            get { return Bs.Of.CMS.WholeS; }
            set { Bs.Of.CMS.WholeS = value; }
        }
    }
    
    class BS
    {
        public virtual Of Of { get; set; }
    }
    
    class Of
    {
        public virtual CMS CMS { get; set; }
    }
    
    class CMS
    {
        public virtual int WholeS { get; set; }
    }
    
    class BitMap : ClassMap<Bit>
    {
        public BitMap()
        {
            References(bit => bit.Bs, "BS_S")
                .Not.LazyLoad();  // should take care, that all is join-loaded
        }
    }
    ...
    
    Bit bit = session.Get<Bit>(25);
    int wholeS = bit.Bs.Of.CMS.WholeS;
    

    oder

    Bit bit = session.Get<Bit>(25);
    int wholeS = bit.WholeS;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently converting a very old, but working classic ASP site to ASP.Net.
I am working on converting the functionality of some JSP pages to GWT. I
I'm working with code I'm converting to Pgsql working with .NET. I want to
I am working in C#.net - .Net fx is 2.0 which doesnot support converting
I'm working on converting an old Struts 1.x application to Spring MVC and in
I've got a bit of a problem. I'm currently working on converting an old
I am working with an old mysql database in which a date is stored
Working on converting an array to another array. In PHP, this is easy, but
I'm currently working on converting an Android app I built natively as an iPhone
Hi I am converting a old vb.net program to WPF and am having trouble.

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.