Hi folks, I just updated my project from 1.2 to 3.2 and ran into
problems with polymorphic many-to-one associations:
<class name="Product" table="sx.bus_product" lazy="false">
...
<many-to-one name="ProductConfiguration" lazy="false" not-
null="false" />
...
</class>
ProductConfiguration is a subclass of an abstract class Configuration
(column "type" as discriminator). When I query products, I now get the
following SQL:
SELECT * FROM product p
LEFT OUTER JOIN productconfiguration pc on p.configurationid = pc.id
WHERE pc.type = 3
This query doesn't return products without a productconfiguration,
because the discirminator is specified in the WHERE clause and not in
the JOIN clause (where I should by in my opinion). I found
https://nhibernate.jira.com/browse/NH-1488 which describes exactly
this problem. Since the issue is closed I suppose this problem is
somehow fixed. But the only solution that I could figure out is to
explicitly specifiy the base class configuration on the many-to-on
which doesn't mimic my business modell where only
productconfigurations are allowed here.
Is there any other solution for that problem ?
Any help is appreciated,
Wolfgang
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.