From: Ricardo P. (JIRA) <nh...@gm...> - 2011-04-08 23:36:53
|
Id Property With Private Setter Not Set With Lazy Classes --------------------------------------------------------- Key: NH-2638 URL: http://216.121.112.228/browse/NH-2638 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.2.0 Reporter: Ricardo Peres Attachments: Test.cs When I have a class with a private id setter, if the class is lazy, then the id is not set. No exception occurs, it simply is not set. Mapping is done with the new mapping by code. Tested with the trunk version, as of 00:00. -- 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-04-10 23:16:58
|
[ http://216.121.112.228/browse/NH-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2638. --------------------------- Resolution: Not an Issue Wrong mapping. You have to specify the accessor of the Id property. > Id Property With Private Setter Not Set With Lazy Classes > --------------------------------------------------------- > > Key: NH-2638 > URL: http://216.121.112.228/browse/NH-2638 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0 > Reporter: Ricardo Peres > Attachments: Test.cs > > > When I have a class with a private id setter, if the class is lazy, then the id is not set. > No exception occurs, it simply is not set. Mapping is done with the new mapping by code. > Tested with the trunk version, as of 00:00. -- 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: Ricardo P. (JIRA) <nh...@gm...> - 2011-04-11 07:53:06
|
[ http://216.121.112.228/browse/NH-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20877#action_20877 ] Ricardo Peres commented on NH-2638: ----------------------------------- Fabio, No, I don't: I have specified all five of them (Field, Property, None, NoSetter and ReadOnly), you can try it yourself. The property is never set. It does work if mapped through hbm.xml, without any problems. It the class is not lazy, then I don't even need to specify the accessor. > Id Property With Private Setter Not Set With Lazy Classes > --------------------------------------------------------- > > Key: NH-2638 > URL: http://216.121.112.228/browse/NH-2638 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0 > Reporter: Ricardo Peres > Attachments: Test.cs > > > When I have a class with a private id setter, if the class is lazy, then the id is not set. > No exception occurs, it simply is not set. Mapping is done with the new mapping by code. > Tested with the trunk version, as of 00:00. -- 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: Ricardo P. (JIRA) <nh...@gm...> - 2011-04-11 11:02:07
|
[ http://216.121.112.228/browse/NH-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20882#action_20882 ] Ricardo Peres commented on NH-2638: ----------------------------------- Test project is here: http://cid-0450c015fc418de2.office.live.com/self.aspx/.Public/NHTest.zip. > Id Property With Private Setter Not Set With Lazy Classes > --------------------------------------------------------- > > Key: NH-2638 > URL: http://216.121.112.228/browse/NH-2638 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0 > Reporter: Ricardo Peres > Attachments: Test.cs > > > When I have a class with a private id setter, if the class is lazy, then the id is not set. > No exception occurs, it simply is not set. Mapping is done with the new mapping by code. > Tested with the trunk version, as of 00:00. -- 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-04-11 11:29:09
|
[ http://216.121.112.228/browse/NH-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20883#action_20883 ] Fabio Maulo commented on NH-2638: --------------------------------- And which is the difference between the mapping through XML and the XML of the mapping by-code ? To see the XML you can use: var mapping = mapper.CompileMappingForAllExplicitAddedEntities(); Console.WriteLine(mapping.AsString()); > Id Property With Private Setter Not Set With Lazy Classes > --------------------------------------------------------- > > Key: NH-2638 > URL: http://216.121.112.228/browse/NH-2638 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0 > Reporter: Ricardo Peres > Attachments: Test.cs > > > When I have a class with a private id setter, if the class is lazy, then the id is not set. > No exception occurs, it simply is not set. Mapping is done with the new mapping by code. > Tested with the trunk version, as of 00:00. -- 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: Ricardo P. (JIRA) <nh...@gm...> - 2011-04-11 11:42:08
|
[ http://216.121.112.228/browse/NH-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20884#action_20884 ] Ricardo Peres commented on NH-2638: ----------------------------------- Fabio, There is no difference. The mapping by code is working well. That is not the problem, you have done an excellent job in that. The problem I am having seems to me related with lazy entities. NH-2639 is the same, I think. If you have time, and interest, please check my demo project: http://cid-0450c015fc418de2.office.live.com/self.aspx/.Public/NHTest.zip. I may be doing something wrong, but I don't think so... I have always (since .NET 3.5, that is) used auto properties, even for ids, and I never had this problem. It is not critical to me, so if you have more urgent things do do, it's fine by me! I only wished I had confirmation from someone else that there is a problem. Thanks! > Id Property With Private Setter Not Set With Lazy Classes > --------------------------------------------------------- > > Key: NH-2638 > URL: http://216.121.112.228/browse/NH-2638 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0Alpha1 > Reporter: Ricardo Peres > Attachments: Test.cs > > > When I have a class with a private id setter, if the class is lazy, then the id is not set. > No exception occurs, it simply is not set. Mapping is done with the new mapping by code. > Tested with the trunk version, as of 00:00. -- 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: Ricardo P. (JIRA) <nh...@gm...> - 2011-04-12 13:47:13
|
[ http://216.121.112.228/browse/NH-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20895#action_20895 ] Ricardo Peres commented on NH-2638: ----------------------------------- Using Castle bytecode provider it works fine, except that lazy properties crash even in lazy entities. I would say that the problem is with the new bytecode provider. > Id Property With Private Setter Not Set With Lazy Classes > --------------------------------------------------------- > > Key: NH-2638 > URL: http://216.121.112.228/browse/NH-2638 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0Alpha1 > Reporter: Ricardo Peres > Attachments: Test.cs > > > When I have a class with a private id setter, if the class is lazy, then the id is not set. > No exception occurs, it simply is not set. Mapping is done with the new mapping by code. > Tested with the trunk version, as of 00:00. -- 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 |