Yes, thats the exact question.

On Mon, Mar 21, 2011 at 10:24 AM, Oskar Berggren
<[email protected]>wrote:

> If you have an instance of Animal in memory, how would you convert it
> to an instance of Dog?
>
> /Oskar
>
>
> 2011/3/21 KotuadaM <[email protected]>:
> > Ho to cast an object in DB to its inherited type?
> > Lets say I have 2 classes.
> > public class Animal { }
> > public class Dog : Animal { }
> > Step 1:
> > Create an instance of Animal and save it into the DB in NHibernate.
> > Step 2:
> > Call the created instance of Animal and take its ID and insert a new
> > instance of Dog in the database with the ID of Animal instance. So now
> the
> > previously inserted Animal will now be Dog in the database.
> >
> > Any idea how to do this?
> >
> > --
> > 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.
> >
>
> --
> 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.
>
>

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