• 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
Need To Get PrimaryKey ID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need To Get PrimaryKey ID


  • Subject: Need To Get PrimaryKey ID
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Fri, 21 Mar 2003 19:44:08 +0000

If there is a better way to do this then please inform me... I'm trying to get the primary key ID so that I can use this as an identifying feature in a directory name (as well as making the directory unique) that I will create for a client's tbJobPicture object.
Below is the Method i am trying to use and I'm getting null value in the WOString element that i'm testing it with in the build for every item in my fetched List...
making the directory is not a problem but trying to get the ID in as part of the name such as - Haydon_334.dir, Jones_8.dir or Haydon_4545.dir - is proving difficult.
I need to be able to stucture the directories like this so that they can be easily identified if needs be, as if they were EO's in the EOModel.
What am I doing wrong to obtain the Object's ID.


Here's the code:

tbJobPicture has PK tbJobPicture & FK tbJobID
tbJob has PK tbJobID & FK tbClientID
----------------------------------------------

   protected TbJob tbJob;
   protected TbJobPicture tbJobPicture;
   protected String sTb_JobID;
   protected String sTb_ClientID;

public Integer tbClientID() {
EOEnterpriseObject tbJobPicture = (EOEnterpriseObject) valueForKeyPath("tbJob");
NSDictionary primaryKey = EOUtilities.primaryKeyForObject(tbJobPicture.editingContext(), tbJob);
NSLog.out.appendln("Dictionary to get tbClientID: " + primaryKey);
String strID = new String();
strID = String.valueOf( (Integer) primaryKey.valueForKey("tbClientID") );
setTb_ClientID(strID);


       return (Integer) primaryKey.valueForKey("tbClientID");
   }


public String getTb_ClientID() { return sTb_ClientID; }

public void setTb_ClientID(String value) {
NSLog.out.appendln( "\nThe Client ID For " + sClientLastName() + " is: " + getTb_ClientID() );
sTb_ClientID = value;
}


Desperatly seeking help with this...
   Many thanks for any help offered

   Regards
   Jonathan




_________________________________________________________________ Express yourself with cool emoticons http://messenger.msn.co.uk _______________________________________________ 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.

  • Follow-Ups:
    • Re: Need To Get PrimaryKey ID
      • From: Jonathan Rochkind <email@hidden>
    • Re: Need To Get PrimaryKey ID
      • From: George Domurot <email@hidden>
    • Re: Need To Get PrimaryKey ID
      • From: Art Isbell <email@hidden>
  • Prev by Date: Re: WO and Sybase Intergration Solved
  • Next by Date: Which Version of Documentation should I use
  • Previous by thread: Using WO instance for multiple background task
  • Next by thread: Re: Need To Get PrimaryKey ID
  • Index(es):
    • Date
    • Thread