|
From: Jenar (JIRA) <nh...@gm...> - 2011-05-09 14:33:58
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21019#action_21019 ]
Jenar commented on NH-2697:
---------------------------
It would be better if you could create some small mapping and test it as you have suggested in your second comment:
"Ok I'll create a little mapping with just two properties..."
I have tried with indexed params "is=?" but it throws exception also.
So problem is with parsing params in HQL if "entity-names" are used.
Thank you very much for your time, it is importand issue for us.
> Named parameter not found in HQL with mapping using "entity-name"
> -----------------------------------------------------------------
>
> Key: NH-2697
> URL: http://216.121.112.228/browse/NH-2697
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Jenar
> Priority: Minor
>
> string HQL = "update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
> Throws exception "System.ArgumentException: Parameter ID does not exist as a named parameter in [update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID]"
> if we use different mapping (through entity-name="..")for the same class ("ArticleItem")
> <class name="ArticleItem" ... entity-name="Article" polymorphism="explicit">
> <class name="ArticleItem" ... entity-name="Article2" polymorphism="explicit">
> The same code was working without problems as we had only one mapping for "ArticleItem":
> <class name="ArticleItem" ... polymorphism="explicit">
> string HQL = "update ArticleItem a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|