@@ -93,7 +93,8 @@ internal static void SetParameterTypes(
9393 continue ;
9494 }
9595
96- namedParameter . Type = GetParameterType ( sessionFactory , constantExpressions , visitor , namedParameter ) ;
96+ namedParameter . Type = GetParameterType ( sessionFactory , constantExpressions , visitor , namedParameter , out var tryProcessInHql ) ;
97+ namedParameter . IsGuessedType = tryProcessInHql ;
9798 }
9899 }
99100
@@ -145,8 +146,10 @@ private static IType GetParameterType(
145146 ISessionFactoryImplementor sessionFactory ,
146147 HashSet < ConstantExpression > constantExpressions ,
147148 ConstantTypeLocatorVisitor visitor ,
148- NamedParameter namedParameter )
149+ NamedParameter namedParameter ,
150+ out bool tryProcessInHql )
149151 {
152+ tryProcessInHql = false ;
150153 // All constant expressions have the same type/value
151154 var constantExpression = constantExpressions . First ( ) ;
152155 var constantType = constantExpression . Type . UnwrapIfNullable ( ) ;
@@ -158,7 +161,7 @@ private static IType GetParameterType(
158161
159162 if ( visitor . NotGuessableConstants . Contains ( constantExpression ) && constantExpression . Value != null )
160163 {
161- return null ;
164+ tryProcessInHql = true ;
162165 }
163166
164167 // No related MemberExpressions was found, guess the type by value or its type when null.
0 commit comments