Re: Compound PK generation

Ricardo Strausz <[email protected]> Fri, 10 Dec 2004 21:31:46 +0100
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
I was referring to non-foreign keys... I missed the point that yours=20
are foreign...
And you are right, the propagate works fine in this scenario (if the=20
model is consistent); however, it is completely against the "EO=20
Principles" to use PKs as class attributes...

BTW, it is not my definition; it is Apple's (I am citing now):

"To take advantage of Enterprise Object=A1=AFs automatic primary-key=20
generation, an entity=A1=AFs primary key must satisfy these guidelines:
  =A1=F6 It must be a simple integer; the adaptor cannot generate keys =
for=20
noninteger data types.
  =A1=F6 It cannot be compound. "

Suerte!
Dino

On Dec 10, 2004, at 10:26 AM, Anders Peterson wrote:

> Depends on your definition of automatically/manually.
>
> It worked fine as long as the to-many relationships that should=20
> propagate the pk-components were class attributes. This, however, was=20=

> not acceptable to me. (I have changed my design.)
>
> With many-to-many relationships it is also done "automatically".
>
> /Anders
>
> On 2004-12-09, at 19.28, Ricardo Strausz wrote:
>
>> Compound keys cannot be assigned automatically by EOF. You have to=20
>> assign them by hand.
>>
>> see the "saving objects" chapter of the "enterprise objects" book...=20=

>> it should be installed somewhere in your hd.
>>
>> Dino
>>
>> On Dec 9, 2004, at 1:06 PM, Anders Peterson wrote:
>>
>>> Hi,
>>>
>>> I have some entities with compound primary keys. The pk components=20=

>>> are all foreign keys.
>>>
>>> I can't get EOF to generate primary keys for new instances unless I=20=

>>> set the corresponding to-many relationships (leading to the=20
>>> troublesome entity) to be class attributes.
>>>
>>> This is going to give me a performance problem. Eventually there=20
>>> will be lots of instances =A8C huge to-many arrays.
>>>
>>> I=A1=AFm hoping I=A1=AFve missed something. Is the only way to get =
rid of the=20
>>> to-many class attributes to have dedicated primary key columns in=20
>>> =A1=B0all=A1=B1 entities?
>>>
>>> /Anders
>>>
>>> _______________________________________________
>>> EOF mailing list
>>> [email protected]
>>> http://www.omnigroup.com/mailman/listinfo/eof
>>
>