Not all named parameters have been set, in query with colon
Description
Environment
Activity

Christian Bauer May 5, 2006 at 9:46 AM
You seem to have the free time to put more effort into something that is solved with a simple query.setParameter(myStringContainingAColon). The way to "deal" with this issue has been extensively discussed in the Hibernate JIRA issue you linked to and it involves a new query parser engine. I have no idea where your "flat tire" analogy comes from, there is nothing "odd" about using bind parameters to escape strings that a query parser doesn't like.
So, unless you want to contribute to this open source software, case closed.

David Givoni May 5, 2006 at 9:36 AM
No, I'm not proposing to work on a port of that parser, I'm suggesting this is an issue, and that it should be dealt with. If I can't do that without getting an "do it yourself" answer, then I'll stop giving response here, and try finding another O/R-Mapper that satisfies my needs. I appreciate the work being put into NHibernate, but not all users of open source solutions have the time to become developers of those solutions as well.
Your first response was like telling me to fix a flat tire by buying a new one. This might be a solution, but it doesn't seem to be a good one. You closed this with a "Not an issue" resolution, but it sounds more like it's too complicated to do right away.

Christian Bauer May 5, 2006 at 8:28 AM
The "solution" is a completely new query parser in Hibernate 3.x. Are you proposing to work on a port of the parser to .NET?

David Givoni May 5, 2006 at 8:25 AM
So basically in order to avoid a colon to be treated as a named parameter, I have to use named parameters? Seems a bit odd...
Did you try looking at how they solved the issue in H3?
http://opensource.atlassian.com/projects/hibernate/browse/HB-1042
I didn't, but from what they write, they came up with a solution.

Christian Bauer May 5, 2006 at 8:00 AM
Use parameter binding if you want to escape strings.
Details
Details
Assignee
Reporter

I get the error:
NHibernate.QueryException: Not all named parameters have been set: Iesi.Collections.ListSet [from Comment where title = 'test' and body = ' ' and userid = 30 and carid = 107]
It seems to come from the ":" which is interpreted as the beginning of a named parameter althoug it is within a string.
I've seen that the issue has been reported for Hibernate as well: http://forum.hibernate.org/viewtopic.php?p=2249465&sid=e9147d96df79d27866baafbcb2eb2588
/David Givoni
(I'm using the NHibernate.JetDriver and framework 1.1 in this projects)