• 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: Displaying Primary Keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Primary Keys


  • Subject: Re: Displaying Primary Keys
  • From: Kaj Hejer <email@hidden>
  • Date: Fri, 26 Dec 2003 18:25:08 +0100

At 08:54 -0500 26-12-03, Drew Thoeni wrote:
public void newbieProblem() {
I read (and have found) that if I want to properly used object references between enterprise objects that I must not include the primary key in the class (i.e., I click the diamond off in EO Modeler). However, there are times I want to display the primary key. For example, in administration pages, I like to display the userID. Or when editing code tables, the primary key would be useful to display.
}


Hi!

You should never have the foreign key as attributes in the EO class, but if you need to display you can include the primary key. That is not that bad :)

If you don't want to have the primary key as attrinute in your EO class you can use the following method from com.webobjects.eoacces.EOUtilities:

public static NSDictionary primaryKeyForObject(EOEditingContext ec,
                                               EOEnterpriseObject object)



-Kaj :)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Displaying Primary Keys (From: Drew Thoeni <email@hidden>)

  • Prev by Date: RE: Displaying Primary Keys
  • Next by Date: Re: Displaying Primary Keys
  • Previous by thread: Re: Displaying Primary Keys
  • Next by thread: Re: Displaying Primary Keys
  • Index(es):
    • Date
    • Thread