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

  • Home
  • SEARCH
  • 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 6213545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:42:56+00:00 2026-05-24T06:42:56+00:00

I use NHibernate 3.2.0 and I cannot make the LINQ provider generate a proper

  • 0

I use NHibernate 3.2.0 and I cannot make the LINQ provider generate a proper SQL query for this statement:

var result = (from translation in session.Query<TmTranslation>()
              where translation.Id > 0
              group translation by translation.Language into grp
              select new { Lang = grp.Key.Code }).ToList();

The generated SQL is

select tmtranslat0_.id                        as id32_,
       tmtranslat0_.status                    as status32_,
       tmtranslat0_.text                      as text32_,
       tmtranslat0_.last_revision             as last4_32_,
       tmtranslat0_.fk_id_translation_unit    as fk5_32_,
       tmtranslat0_.fk_id_translator          as fk6_32_,
       tmtranslat0_.fk_id_last_modifier       as fk7_32_,
       tmtranslat0_.fk_id_last_match_category as fk8_32_,
       tmtranslat0_.fk_id_language            as fk9_32_
from   "TRANSLATION" tmtranslat0_
where  tmtranslat0_.id > 0

which, of course leads to loading all the entities from the database and grouping the result set in memory (the result itself is correct).

I would like something like this

select tmtranslat0_.fk_id_language
from   "TRANSLATION" tmtranslat0_
where  tmtranslat0_.id > 0
group by tmtranslat0_.fk_id_language

to be generated instead.

Am I missing something?

Thank you very much.

  • 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-24T06:42:57+00:00Added an answer on May 24, 2026 at 6:42 am

    The only thing I can suggest, is to use QueryOver API.

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

Sidebar

Related Questions

For our test fixtures we use NHibernate to generate a database schema. We have
I'm new to NHibernate. If I use NHibernate to generate GUIDs for inserts to
I want to make a JPQL query with a collection of non entities. This
I use NHibernate to persist my objects.. However, I cannot seem to find any
We're currently migrating our database back-end from Firebird to PostgreSQL. We use NHibernate as
I'm trying to generate NHibernate mappings with ActiveRecord. I can create classes from a
I'm in the process of converting a LINQ2SQL project to use NHibernate. One query
I'm working on a system to use a SqlServerCe with NHibernate . From my
After too much thought, I've decided to use Linq To SQL as a DAL
I use NHibernate for my dataacess, and for awhile not I've been using SQLite

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.