Sly,

   I ended up created a Role class with a subclass of Student.  The
Role class points back to the Person class for traversing to that
object but is working fantastic and can be modified without affecting
the Person.  When I want a Student, I ask for the Student via my
StudentRepository class and then can traverse to the Person class is
necessary.

-Good luck!
-Dave

On Mar 4, 10:47 am, Sly <[email protected]> wrote:
> I'm having the same problem. Is there any solution where I don't need
> to redesign application?
>
> On Feb 20, 10:01 pm, Germán Schuager <[email protected]> wrote:
>
>
>
> > Use composition instead of inheritance.
>
> >http://www.cs.sjsu.edu/faculty/pearce/modules/patterns/analysis/Actor...
>
> > On Fri, Feb 20, 2009 at 3:59 PM, deuce <[email protected]> wrote:
>
> > > I have the following simple class structure, simplified for post:
>
> > > class Person
> > > {
> > >    public int ID;
> > >  }
>
> > > class Student : Person
> > > {
> > >   public Student(Person person){}
> > > }
>
> > > The problem I am facing is when I pass in the person and assign all
> > > the values to this object including the ID, it wants to update when I
> > > call SaveOrUpdate.  I need to save the student WITHOUT modifying the
> > > ID of the person.  So since the person class has already been
> > > persisted, I just need the INSERT for the subclass.
>
> > > On the other end of this, how would I go about removing the Student
> > > subclass BUT leaving the person?- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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