The .class metapropety works with any inheritance stragegy other than
implicit. Can you post your real classes and mappings?
Diego
On Wed, Aug 4, 2010 at 17:15, Matthieu GD <[email protected]> wrote:
> No I got the error quoted (Conversion failed when converting the
> nvarchar value
> 'FullName.DogClassNameHere' to data type int. ).
>
> Maybe it's because I'm using the "Table per Suclass" strategy and not
> the "One table for the class hiearchy" one ?
>
> On Aug 4, 4:12 pm, Jason Meckley <[email protected]> wrote:
> > i think this would work
> > var people = session
> > .CreateQuery("from Person p join p.Animals a where a.class
> > = :type")
> > .SetParameter("type", typeof(DomesticCat))
> > .List<Person>();
> >
> > On Aug 4, 3:33 pm, Matthieu GD <[email protected]> wrote:
> >
> >
> >
> > > Hello,
> >
> > > I got this polymorphic association
> >
> > > One Individual has many Animals (Animal is a class with subclasses
> > > like Dog and Cat, ). Now I want to retrieve individuals with animals
> > > of type Cat. I come across the meta-type property and this kind of
> > > queries :
> >
> > > from Eg.Cat cat where cat.class = Eg.DomesticCat
> > > or here another :
> http://randomcode.net.nz/2008/09/19/restricting-types-returned-from-a...
> >
> > > But when I try with my association I got this SQL error :
> > > Conversion failed when converting the nvarchar value
> > > 'FullName.DogClassNameHere' to data type int.
> >
> > > and in Criteria I got the error that Class property is not found on
> > > Animal.
> >
> > > I can do a right join on a property of Cat but I don't have any
> > > required property on it.
> >
> > > Matthieu
>
> --
> 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.