• 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: Getting an abstract ID key - how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting an abstract ID key - how?


  • Subject: Re: Getting an abstract ID key - how?
  • From: George Domurot <email@hidden>
  • Date: Sat, 1 Feb 2003 16:47:52 -0500

Place this method in your object to have it return its PK:

import com.webobjects.eoaccess.EOUtilities;

     public Number primaryKey(){
         try{
             NSDictionary primaryKeys =
EOUtilities.primaryKeyForObject(editingContext(),
(EOEnterpriseObject)this);
             NSArray keyValues = primaryKeys.allValues();
             return (Number)keyValues.objectAtIndex(0);
         } catch (Exception e){
             return (Number)(new Integer(0));
         }
     }

##
_______________________________________________
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.

  • Prev by Date: Re: Unable to build project after moving it into a new directory
  • Next by Date: 10.2-Server Headless Graphics WOes
  • Previous by thread: Re: Getting an abstract ID key - how?
  • Next by thread: Unable to build project after moving it into a new directory
  • Index(es):
    • Date
    • Thread