Linq Fetch over component has no effect on generated SQL

Description

fixed the exceptions that occured when a Linq query with a fetch on a component was executed but the fetch has still no effect on the generated SQL.

Attached is a patch that modifies the already existing test (NHSpecificTest\NH2705) so it also checks the generated statement.

Environment

None

Attachments

1

Activity

Show:

Alex Zaytsev September 2, 2020 at 8:27 PM

Fixed in 5.3.x


Moved here.

Alex Zaytsev July 27, 2018 at 10:12 AM

Moved here.

Now the generated hql expression is equivalent to

But it should be:

In other words the Linq translator has to detect that `c.Address` is mapped as a component and should not add a join fetch for it, but instead for `c.Address.Company`.

Ahmed Zeyada December 24, 2015 at 8:57 PM

is there any workaround for this problem ? the only way i can see is fetching it through lazy loading which is not good solution

David Roth February 15, 2013 at 1:01 PM

New github location for the testcase: https://github.com/davidroth/nhibernate-core/tree/NH3373

Oskar Berggren January 18, 2013 at 8:34 AM

David Roth has made a test case available at:
https://github.com/davrot/nhibernate-core/tree/NH3373

Obsolete

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created June 16, 2011 at 1:53 AM
Updated September 2, 2020 at 8:27 PM
Resolved September 2, 2020 at 8:27 PM
Who's Looking?