He may have mapped B as an unrelated class to A, not as a subclass. Either way, I suspect he has a string property called Discriminator and is querying by that value.
Eduardo - please share your classes and mappings please. Thanks! On Wed, Jul 14, 2010 at 3:43 PM, José F. Romaniello <[email protected]>wrote: > please show real code, I can't follow your question. > > 2010/7/14 Eduardo Costa <[email protected]> > > I used all, but the discritinator works if i set discriminator value >> for all child classes, but when i getting the parent class i need get >> child too. >> >> Registers A >> >> 1 >> 2 >> 3 >> >> Registers B >> >> 4 >> 5 >> >> >> get B result 4,5 >> get A result 1,2,3,4,5 >> >> >> >> On 14 jul, 15:00, José F. Romaniello <[email protected]> wrote: >> > use nhibernate; >> > >> > http://www.nhforge.org/doc/nh/en/index.html#inheritance >> > >> > BTW; you will never need a property or field for the discriminator. >> > <http://www.nhforge.org/doc/nh/en/index.html#inheritance> >> > >> > 2010/7/14 Eduardo Costa <[email protected]> >> > >> > > Hi, >> > >> > > I have this problem. >> > >> > > Class A >> > > { >> > > string Discriminator; >> > > } >> > >> > > Class B inherits A >> > > { >> > > } >> > >> > > I need when I get a list of Class A find A plus B and when I get a >> > > list of Class B find only B based in discriminator property >> > >> > > -- >> > > 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]<nhusers%[email protected]> >> <nhusers%[email protected]<nhusers%[email protected]> >> > >> > > . >> > > For more options, visit this group at >> > >http://groups.google.com/group/nhusers?hl=en. >> >> -- >> 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]<nhusers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> >> > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- 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.
