Re: Wonder PK id in the EOModel
Re: Wonder PK id in the EOModel
- Subject: Re: Wonder PK id in the EOModel
- From: Gustavo Pizano <email@hidden>
- Date: Thu, 20 Mar 2008 18:17:26 -0500
leaving only the id as Pk will allow another Person to rgister with
the same document like this
id docuemnt phone address
1 123 555 XXXX
2 123 555 XXXX
and that would be an inconsistency no?
Gus
On Mar 20, 2008, at 5:02 PM, David Holt wrote:
I would say no. The best practice is that the Primary Key has no
meaning outside of the database, and by definition the "id" field
given by default will be unique for each row in the database. This
means it should not be visible as a class property. If you look at
the Wonder generated PK you'll see that the little diamond is not
appearing beside it in Entity Modeler. You should keep your
"document" separate if it has meaning in your Person object. There
is no need to add "document" to the PK since "id" is unique by itself.
If you find you do need to access your PK later, you can do so
following the directions at this page:
http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-Primary+Keys
David
On 20-Mar-08, at 2:35 PM, Gustavo Pizano wrote:
Well I started to create the EOModel and the questions began to
arise.
I c that Wonder gives me an id as Pk, but in the model I have te
follwoing, something similar to what David showed in the screencast
(Using the folloing names just to follow the project statement)
Table : Person
Atributes: document
phone
address
so if there is and id as PK, shouldnt I put the document as PK as
well? to avoid data repetitions?,
Gus
_______________________________________________
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