If you have only one class mapped then the only thing it can return is that one class so why would it need the address_type_code column?
One of your previous emails indicated the problem was returning all rows from the table. I'm confused about what the problem is your tryign to solve. Jon -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Lin Sent: Friday, September 26, 2008 12:19 PM To: nhusers Subject: [nhusers] Re: Discriminator bug I'll rephrase it another way. shouldn't the select statement always include address_type_code column, since it is the discriminator column? We've established the discriminator column isn't a property, but it needs to be included in the select statement so that polymorphic queries work correctly. this doesn't mean including address_type_code in the where clause. the way NHibernate and Hibernate work today is it adds the discriminator column as the last column in the select clause so that it can handle polymorphic queries properly and create an instance of the correct object. peter On Sep 26, 2:54 pm, "Jon Palmer" <[EMAIL PROTECTED]> wrote: > I disagree, the current implementation is exactly right. > > In a normal situation your table has only data that is mapped in NHibernate (ie all the values of the discriminator column are mapped to some class). Now if I perform a query for the base class I DON'T want NHibernate to put in an spurious where clause which will be true for all rows in the table. > > I think its right that it works the way it does and you have to employ a work around in your legacy data case. > > Jon > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
