From: NHibernate J. <nh...@gm...> - 2009-01-10 01:50:33
|
one-to-many collection doesn't work if the child is mapped using table per class -------------------------------------------------------------------------------- Key: NH-1642 URL: http://jira.nhibernate.org/browse/NH-1642 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 2.0.1.GA Reporter: Kiran Gawde Priority: Major Attachments: KGTest.rar In the attached example, I have parent object TrafficRuleSet. It contains list of TrafficRule. TrafficRule has a backpointer to TrafficRuleSet. Also, TrafficRule is subclassed from AbstractRule. These are represented with three different tables. Now, when you try to retrieve the TrafficRuleSet and associated TrafficRules, it generates following query: select * from Traffic_RuleSet where gr.ruleset_id = '3' select * from Generic_Rule gr inner join Traffic_Rule tr on gr.rule_id = tr.rule_id where gr.ruleset_id = '3' (Note: Above sqls are simplied for clarity.) The second sql above is wrong. It should have been: select * from Generic_Rule gr inner join Traffic_Rule tr on gr.rule_id = tr.rule_id where tr.ruleset_id = '3' -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |