From: Fabio M. (JIRA) <nh...@gm...> - 2011-04-23 20:08:28
|
[ http://216.121.112.228/browse/NH-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-1747. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 Applied the whole fix... we have to add an early check for column-name used to represent different relations (comments added to the code for possibly future issues) > Lazy load failure on items using <join> if FK for bag is in the secondary table > ------------------------------------------------------------------------------- > > Key: NH-1747 > URL: http://216.121.112.228/browse/NH-1747 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 2.1.0.Alpha2 > Reporter: Anne Epstein > Priority: Minor > Fix For: 3.2.0Alpha3 > > Attachments: NH1747.zip > > > When an element is mapped using <join> that contains a many-to-one that has that many-to-one key in the secondary table, and that element is put in a bag and lazy-loaded, the lazy load fails because the resulting SQL looks for the key in the element's primary table, not the secondary table. > I'm attaching a test-when I run this on a preexisting db, it gives a SQL error for a nonexisting column. When a schema is generated from the mapping, it (incorrectly) has the many-to-one FK in both the primary and secondary element tables-it uses the correct one when traversing from the element, but uses the wrong one when traversing from bag to child elements. > The core issue seems to be that NHibernate doesn't know (and there doesn't seem to be a way) to tell a bag that the key column is in a secondary table of a join, not the primary one. -- 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 |