-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Not all named parameters have been set
PostPosted: Fri May 05, 2006 9:02 am 
Beginner
Beginner

Joined: Thu Oct 20, 2005 9:26 am
Posts: 27
Location: Barcelona
I have a problem whenever I try to insert a text with a ":" in it.
NHibernate mistakes it as a named parameter and gives me an error, since there isn't any value for it.

[QueryException: Not all named parameters have been set: [] [from Comment where title = 'sfd' and body = ':' and userid = 30 and carid = 62]]
NHibernate.Impl.AbstractQueryImpl.VerifyParameters() +379
NHibernate.Impl.QueryImpl.List() +13
NHibernate.Impl.AbstractQueryImpl.UniqueResult() +4

How can I avoid this?

/David


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 05, 2006 11:20 am 
Beginner
Beginner

Joined: Thu Oct 20, 2005 9:26 am
Posts: 27
Location: Barcelona
I created an issue about this here two months ago:

http://jira.nhibernate.org/browse/NH-566

and finally today I got a response:

"Use parameter binding if you want to escape strings."

So what I understand from this short answer is that in order to avoid a colon being treated as a named parameter, I should use named parameters?
This sounds a bit stupid to be honest, but if there's no intention on creating a way to escape the character, I guess I'll have to do that.

:(

/David


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.