Open nhibernate-bot opened 7 years ago
Hm.. All of these methods generate HqlLike
node. So parameter detection implemented in
https://github.com/nhibernate/nhibernate-core/blob/74b97af3474d42311a46dd6ec832a11ddf7ae689/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryLogicOperatorNode.cs#L56-L66
should handle and apply proper parameter type (where lhs
is mapped property with known type, and rhs
- constant parameter)
But this functionality is broken because parameter is guessed and specified for constant as StringType when LINQ query is processed: https://github.com/nhibernate/nhibernate-core/blob/ec634f50ff2a36ce1f5705a361269d47a9ea1de8/src/NHibernate/Linq/Visitors/ParameterTypeLocator.cs#L159-L164
If this guessing is removed - parameter is properly applied as AnsiString
.
Oups.. Without guessing parameter detection only properly works for Like
. It's still broken for StartsWith and other methods.
For possible fix see https://github.com/nhibernate/nhibernate-core/pull/2793#issuecomment-851673251
Nicolás Sabena created an issue — :