Query by types, where Id field has System.Object type, thrown "Invalid join" exception

Description

When mapped class contains an id field with System.Object type, but in mapping this field has any other type, I have an exception when executing a simple Select(x => x.Id) query.
I found a solution for me in class NHibernate.Impl.SessionFactoryImpl by adding following test:

This function returns all known mapped types when parameter is System.Object, but it does not make sense.

Environment

None

Activity

Show:

Frédéric Delaporte 
August 2, 2017 at 12:28 PM
(edited)

May you please supply a test case for the issue? See, by order of preference, contributing, or create a test case.

Severity changed to minor. Typing properties as object while using them as another single more specialized type is a not a recommended practice with a strongly typed language such as a .Net language. This is not an usual use case. If the issue is confirmed, it likely does not impact many users.

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created July 27, 2017 at 9:03 PM
Updated August 2, 2017 at 12:41 PM
Who's Looking?