Re: [Modeling-users] primary key + class property
Status: Abandoned
Brought to you by:
sbigaret
From: Yannick G. <yan...@sa...> - 2003-02-20 21:08:59
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 20 February 2003 04:56 pm, you wrote: > > > How can I have *automatic* primary keys that I can see ? > > > > By setting default value to 0 + isRequired to 1. > > Could you please be more specific? Do you say that automatic generation > of primary key does not work if you define it as a class property??? > More on this: the framework does not support setting the primary key of > an object by hand --that's why I really want more details on what > happened to you here. > > If this is the case, this is a bug I really want to trace: this should > NOT happen, and I cant even see now how automatic pk generation could > be defeated when the primary key is a class property (it is nnot even > checked when insertedObjects of an EditingContext are processed). > > However you are right: the default value should be 0, and isRequired > must always be set to 1 for a PK (being a class property or not). I had a default value set to 'None' for the primary key of an entity. It worked perfectly as long as the primary key was not a class property. When I turned it (the primary key) to a class property, I was not able to create an object anymore. When saving the changes, the editing context was complaining about a required field not initialized. I changed the default value to 0 and it worked. - -- Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+VUPprhy5Fqn/MRARAoHUAKCQvgh2zKEYWa87aBd5CPrKxMgLFQCfQ2Li Mk1ImygzRKW2Hq3RcCFVo48= =L4/r -----END PGP SIGNATURE----- |