From: Jenar (JIRA) <nh...@gm...> - 2011-05-06 08:42:59
|
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: Critical 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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-06 13:59:06
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21002#action_21002 ] Fabio Maulo commented on NH-2697: --------------------------------- Now we have to think a domain, write its mappings, write a test and only then we can try a fix. Perhaps you may help translating your instruction in a test. > 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: Critical > > 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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-06 13:59:10
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2697: ---------------------------- Priority: Minor (was: Critical) > 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 |
From: Jenar (JIRA) <nh...@gm...> - 2011-05-06 14:23:08
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21004#action_21004 ] Jenar commented on NH-2697: --------------------------- I have described it shortly, because it is a part of our bigger application. Please tell me what you exactly need. Should i send whole mapping, test or something like this ? > 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 |
From: Jenar (JIRA) <nh...@gm...> - 2011-05-06 14:25:07
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21005#action_21005 ] Jenar commented on NH-2697: --------------------------- PS. Mapping can be found hier: https://forum.hibernate.org/viewtopic.php?f=25&t=1010801 > 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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-06 14:51:08
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21006#action_21006 ] Fabio Maulo commented on NH-2697: --------------------------------- Ok I'll create a little mapping with just two properties. If I can recreate the issue than I'll try a fix, otherwise "Cannot reproduce". > 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 |
From: Lars S. (JIRA) <nh...@gm...> - 2011-05-06 15:51:07
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21007#action_21007 ] Lars Schneider commented on NH-2697: ------------------------------------ I'm a collegue of jenar and just curious: Basically you are saying that it seems that our code should be working? Because all the time we where thinking that something might be wrong with the code, but we couldn't find clear examples. Most examples are much working with much simpler mapping files. If you can't reproduce the issue it would be nice if you can give us a hint what might be wrong with the mapping. Thanks in advance. > 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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-06 21:57:48
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21010#action_21010 ] Fabio Maulo commented on NH-2697: --------------------------------- Lars, Have you tried? > 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 |
From: Lars S. (JIRA) <nh...@gm...> - 2011-05-07 11:37:45
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21014#action_21014 ] Lars Schneider commented on NH-2697: ------------------------------------ As posted in the hibernate forum we tried and always got the exception as stated by jenar. But we can't see anything wrong, so we assume that there might be a bug in nhibernate. I now just wanted to ask if you have looked at the posting in the forum withe the complete mapping file? And if the file and also the used HQL query code seems to be alright to you, so that this might really be a bug. Or do you see anything wrong in the code? > 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 |
From: Jenar (JIRA) <nh...@gm...> - 2011-05-09 05:51:54
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21017#action_21017 ] Jenar commented on NH-2697: --------------------------- Yes we have tried this code and mapping. First we had only one mapping for "ArticleItem" and in developing process we had extendet it to "Article" and "Activity_Article". So after that we got exception "..Parameter ID does not exist as a named parameter in" with almost the same HQL. (Only class name was changed to Entity-name in it). > 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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-09 14:20:55
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21018#action_21018 ] Fabio Maulo commented on NH-2697: --------------------------------- To both, In your opinion, what we should do if we copy and paste that mapping to create a test and then we discover that we can't use it because we don't have some needed classes ? Should we invent those classes ? Or can we ignore it ? > 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 |
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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-09 16:32:56
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21020#action_21020 ] Fabio Maulo commented on NH-2697: --------------------------------- Perhaps it is not so important. If it were important you would send us a test to recreate the issue instead ask us to jump here and there to see a mapping, try various configuration and only then try a fix. > 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 |
From: Jenar (JIRA) <nh...@gm...> - 2011-05-10 05:31:59
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21029#action_21029 ] Jenar commented on NH-2697: --------------------------- Ok i will create test and send it to you. > 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 |
From: Jenar (JIRA) <nh...@gm...> - 2011-05-10 08:17:51
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jenar updated NH-2697: ---------------------- Attachment: NHibernate.Test NH-2697.zip I have prepared a Test for it. Take a look at: + Can_SetArticleFavoriteWithHQL_NamedParam() Exception param not found in HQL + Can_GetListOfArticles() no objects returned with HQL in SampleTest.cs I have attached also nh2697.fdb for testing. If Test is not perfectly made/configured sorry for that, because i am using other utils and this is my first NUnit test. Hope it will help you. > 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 > Attachments: NHibernate.Test NH-2697.zip > > > 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 |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-10 16:58:50
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2697. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 Fixed both bugs reported > 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 > Fix For: 3.2.0Beta1 > > Attachments: NHibernate.Test NH-2697.zip > > > 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 |
From: Jenar (JIRA) <nh...@gm...> - 2011-05-11 05:41:02
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21046#action_21046 ] Jenar commented on NH-2697: --------------------------- Thank you for quick fix for this issue. > 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 > Fix For: 3.2.0Beta1 > > Attachments: NHibernate.Test NH-2697.zip > > > 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 |