NHibernate.Linq parses custom Expression improperly

Description

I'm building a custom Expression and handing it to NHibernate's QueryProvider, and attempting to execute it. I'm somewhat familiar now with the internals of NHibernate's Linq implementation, and the use of ReLinq... but I'm not sure who this bug belongs to.

Visitors/QueryModelVisitor.cs, in VisitAdditionalFromClause, checks whether the FromExpression.Expression is a QuerySourceReferenceExpression. This type is some ReLinq component, that I think is supposed to reference an additional FromClause in some fashion. My custom Expression does not have this, and ReLinq isn't creating it. I'm hitting the 'throw new NotSupportedException()' that happens if the type of member.Expression is not a QuerySourceReferenceExpression.

Instead, the member.Expression is a ParameterExpression. I simply am adding a new HqlFromClause, just like the existing code, in the case of a ParameterExpression. This seems to work fine.

I think Relinq is supposed to generate the QuerySourceReferenceExpression from the original ParameterExpression. What might I be missing in my custom Expression to cause this? Or... is this a ReLinq bug?

Environment

None

Activity

Show:

Alex Zaytsev 
November 20, 2014 at 10:07 AM

Closing as incomplete

Incomplete

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created March 31, 2011 at 1:31 PM
Updated November 20, 2014 at 10:07 AM
Resolved November 20, 2014 at 10:07 AM
Who's Looking?