Re: database concept help
Re: database concept help
- Subject: Re: database concept help
- From: Paul D Yu <email@hidden>
- Date: Wed, 29 Sep 2010 09:40:28 -0400
Ted
Conceptually, if the association entity (PeopleJob) is just that an association between the two EO's and no other attributes are on the the association then Flatten is good. However, if you have another attribute such as isPrimary on the PeopleJob or startDate then flatten would not be the right approach.
Paul
On Sep 29, 2010, at 9:14 AM, Theodore Petrosky wrote:
> so I am creating a little test.
>
> I have a People and a Job entity.
> attributes:
>
> People has a personName attribute
> and
> Job has a jobtitle
>
> I created the many to many selecting the Flatten Relationship option.
>
> I get a new entity: PeopleJob
>
> so far so good.
>
> I see in _Job.java a method:
>
> addToPeoplesRelationship but no 'set'. Was that a typo on your part?
>
> I am going to continue playing with my test app and see where it leads me.
>
> thanks for the help.
>
> Ted
>
> --- On Wed, 9/29/10, Pascal Robert <email@hidden> wrote:
>
>> From: Pascal Robert <email@hidden>
>> Subject: Re: database concept help
>> To: "Theodore Petrosky" <email@hidden>
>> Cc: email@hidden
>> Date: Wednesday, September 29, 2010, 6:47 AM
>>
>> Le 2010-09-29 à 06:42, Theodore Petrosky a écrit :
>>
>>> I am altering a project (adding a relation) and I
>> don't understand the "Flatten relationship" option.
>>>
>>> this will be a many to many. I just don't understand
>> what flattening does. I started googling and so far the
>> answers don't click.
>>>
>>> what's happening in a flattened vs an un-flattened
>> relationship.
>>
>> Flattened means that the table in the middle (that only
>> holds the keys to join the two other tables) is "hidden" in
>> the EOs, and when you create a new object in one of the two
>> tables, the join table will automatically be populated.
>>
>> So let's say you have a People and a Job tables, and the
>> join table is People_Job, to add a new job to a person, you
>> do :
>>
>> aPerson.setRelationJob(newJob)
>>
>> No need to do aPerson.setRelationshipPeopleJob(new
>> PeopleJob).
>
>
>
> _______________________________________________
> 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
_______________________________________________
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