• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: exposing the primary key?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exposing the primary key?


  • Subject: Re: exposing the primary key?
  • From: Ramsey Gurley <email@hidden>
  • Date: Fri, 28 Feb 2014 15:18:01 -0700

EOF can handle it. Sure. But users can’t handle the Primary Key! [Jack Nicholson face] Expose it, and they’ll want to change it. Guaranteed.

Besides, just displaying it is no reason to expose it. You can display it just by using ERXGenericRecord’s primaryKey() method. You can fetch by PK too, ERXEOControlUtilites.objectWithPrimaryKeyValue or ERXEOGlobalIDUtils.fetchObjectsWithGlobalIDs. Plus, once you expose it, you have to populate it yourself. That is a headache all on its own.


On Feb 28, 2014, at 2:48 PM, Chuck Hill <email@hidden> wrote:

Actually, exposing the PK is fine with EOF.  Exposing an FK is what causes real problems.


On 2014-02-28, 1:47 PM, "Aaron Rosenzweig" wrote:

Hi Ted,

If you must expose the primary key… make a duplicate attribute with a Read format and make it read only.

Look at page 41 of this document:
https://developer.apple.com/legacy/library/documentation/WebObjects/UsingEOModeler/UsingEOModeler.pdf

Exposing the PK as a class property could mess with the way EOF assigns the PK and it opens it up to possibly being modified.
Aaron Rosenzweig / Chat 'n Bike
e:  email@hidden  t:  (301) 956-2319
Chat 'n Bike Chat 'n Bike

On Feb 28, 2014, at 4:41 PM, Jesse Tayler <email@hidden> wrote:

generate a unique ID, if you don’t mind using HEX….




On Feb 28, 2014, at 4:32 PM, Chuck Hill <email@hidden> wrote:

Does it mean anything to the user?  I assume it does, otherwise, why would you show it?  So what is going to happen when they see this:
id number    description     client
     3456         Blue Dress     Amex
     3457         Blue Socks     Chuck
     3459         Blue Tie     Ted
     3460         Blue Blouse     Visa

Where is 3458?  Because that IS going to happen if you use the PK.

Chuck


On 2014-02-28, 1:25 PM, "Theodore Petrosky" wrote:

I need to create an Entity that will have a user visible id number. I thought I would just use the primaryKey but I recall reading so many times don't use the primaryKey for this.

This is a very simple Entity. It has a description, a Client, and a boolean (isActive). When the user views a list of these Entities, he/she will see:

id number    description     client
     3456         Blue Dress     Amex

when I insert a new Entity, I only need to supply the description and Client (from a popup). WO will supply the ID number. So why not use the primaryKey here? The user can never edit it. and none of these Entities will ever be deleted.
_______________________________________________
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

_______________________________________________
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
  • Follow-Ups:
    • Re: exposing the primary key?
      • From: Chuck Hill <email@hidden>
References: 
 >exposing the primary key? (From: Theodore Petrosky <email@hidden>)
 >Re: exposing the primary key? (From: Chuck Hill <email@hidden>)
 >Re: exposing the primary key? (From: Jesse Tayler <email@hidden>)
 >Re: exposing the primary key? (From: Aaron Rosenzweig <email@hidden>)
 >Re: exposing the primary key? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: exposing the primary key?
  • Next by Date: Re: exposing the primary key?
  • Previous by thread: Re: exposing the primary key?
  • Next by thread: Re: exposing the primary key?
  • Index(es):
    • Date
    • Thread