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.
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.
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 simpleSelect(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.