From: Onur G. (JIRA) <nh...@gm...> - 2011-04-21 18:50:35
|
Formula on Many-to-one pointing to a composite-keyed entity don't work ---------------------------------------------------------------------- Key: NH-2665 URL: http://216.121.112.228/browse/NH-2665 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.2.0Alpha2 Reporter: Onur Gumus Priority: Major Hello, it seems the following mapping won't work <many-to-one formula="(select top 1 id1, id2 from SomeEntity")/> in this case id1 and id2 are composite Id's for SomeEntity. NHibernate will complain it was expecting two columns while validating the mapping. -- 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-22 19:14:41
|
[ http://216.121.112.228/browse/NH-2665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20938#action_20938 ] Fabio Maulo commented on NH-2665: --------------------------------- What you mean ? where are you using that mapping line where is the mapping of "SomeEntity" ? many-to-one has <formula> tag (not attribute) and you should use it in case of composite-id. please attach a failing tests case. > Formula on Many-to-one pointing to a composite-keyed entity don't work > ---------------------------------------------------------------------- > > Key: NH-2665 > URL: http://216.121.112.228/browse/NH-2665 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0Alpha2 > Reporter: Onur Gumus > Priority: Major > > Hello, it seems the following mapping won't work > <many-to-one formula="(select top 1 id1, id2 from SomeEntity")/> > in this case id1 and id2 are composite Id's for SomeEntity. NHibernate will complain it was expecting two columns while validating the mapping. -- 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: Onur G. (JIRA) <nh...@gm...> - 2011-04-22 19:47:46
|
[ http://216.121.112.228/browse/NH-2665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20943#action_20943 ] Onur Gumus commented on NH-2665: -------------------------------- Sorry I use attributes normally. above case SomeEntity is a table actually also it is an entity with composite ids. The problem is Mapping validation process assumes if the many-to-one class has a composite id It must have two columns mapped. This check should be skipped if formula is used. I don't have test case right now but i will prepare one. > Formula on Many-to-one pointing to a composite-keyed entity don't work > ---------------------------------------------------------------------- > > Key: NH-2665 > URL: http://216.121.112.228/browse/NH-2665 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0Alpha2 > Reporter: Onur Gumus > Priority: Major > > Hello, it seems the following mapping won't work > <many-to-one formula="(select top 1 id1, id2 from SomeEntity")/> > in this case id1 and id2 are composite Id's for SomeEntity. NHibernate will complain it was expecting two columns while validating the mapping. -- 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-22 19:58:42
|
[ http://216.121.112.228/browse/NH-2665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2665. --------------------------- Resolution: Not an Issue You can map the formula per each expected parts of the compisite-id. <many-to-one name="Blah"> <formula>formula for the first element of the id</formula> <formula>formula for the second element of the id</formula> </many-to-one> > Formula on Many-to-one pointing to a composite-keyed entity don't work > ---------------------------------------------------------------------- > > Key: NH-2665 > URL: http://216.121.112.228/browse/NH-2665 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0Alpha2 > Reporter: Onur Gumus > Priority: Major > > Hello, it seems the following mapping won't work > <many-to-one formula="(select top 1 id1, id2 from SomeEntity")/> > in this case id1 and id2 are composite Id's for SomeEntity. NHibernate will complain it was expecting two columns while validating the mapping. -- 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 |