I found an interesting bug with discriminators the other day. Since
HNibernate.org DNS is down, I can't enter a jira for it.  Here is a
summary of the scenario.

Create a class that uses discriminator, but don't have a subclass.
When NHibernate generates the query, it doesn't include the
discriminated column in the select statement.

Then add a subclass. The select statement magically includes the
discriminated column as the last column in the statement as expected.
To work around this issue, there's 2 solutions. The first is to create
a discriminated subclass, even if you don't need one at the moment.
The second is to create a view with the appropriate where clause to
filter the data and map to the view.

In most cases, I think people will have a subclass, but there are
situations where you want to use discriminator, but there's only 1
class in the beginning.

peter

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to