Re: accessing relation...
Re: accessing relation...
- Subject: Re: accessing relation...
- From: Theodore Petrosky <email@hidden>
- Date: Tue, 5 Feb 2008 07:46:45 -0800 (PST)
This is how it was set up.... but thinking it through
I realized that a person can have only one extension
and one desk position and one DID for the phone so I
changed the relationship to a to:1
EmployeeName <-> EmployeeBusinessMeta
now I know I will have a problem figuring out the
employeepersonalmeta
as a person could have two (or more) addresses and
phones or cell phones...
I will cross this bridge when I get there.
Thanks all.
Ted
--- David Avendasora <email@hidden>
wrote:
> Hi Theodore,
>
> If I remember correctly your relationship is
> EmployeeNames <->>
> EmployeeBusinessMeta, right?
>
> If so, then since the relationship to
> EmployeeBusinessMeta is a To-
> Many relationship, you can't just reach across and
> set the isCurrent
> () value because WO has no idea which of the
> potentially many
> EmployeeBusinessMeta objects you are trying to
> update.
>
> You'll have to call setIsCurrent(false) on each
> EmployeeBusinessMeta
> object that you want to update.
>
> Dave
>
>
>
> On Feb 5, 2008, at 9:57 AM, Theodore Petrosky wrote:
>
> > OK.... I have a table 'EmployeeNames' that has a
> > relationship EmployeeeBusinessMeta.
> >
> > I want to update the 'iscurrent' column of the
> > EmployeeeBusinessMeta table.
> >
> > in my un-normalized version where the iscurrent
> > attribute lived in EmployeeNames I just set it
> like
> > this:
> >
> > EOEditingContext ec =
> > session().defaultEditingContext();
> > ec.revert();
> > anEmployee.setIscurrent(false);
> > ec.saveChanges();
> >
> > now that the attribute lives in the related table
> > EmployeeeBusinessMeta how do I set it. I tried:
> >
>
anEmployee.employeeBusinessMetas.setIscurrent(false);
> > to no avail...
> >
> > I am just a little lost
> >
> > Ted
> >
> >
> >
> >
>
______________________________________________________________________
>
> > ______________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> http://
> >
> mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will
> be ignored.
> > Webobjects-dev mailing list
> (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
>
>
> > 40avendasora.com
> >
> > This email sent to email@hidden
> >
> >
>
>
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden