Getting the Primary Key From A Method
Getting the Primary Key From A Method
- Subject: Getting the Primary Key From A Method
- From: "Jonathan Fleming" <email@hidden>
- Date: Tue, 17 Dec 2002 22:31:47 +0000
I have this code that I want to extract the ID from but it is
eluding me how to get it.
I'm usually getting my ID from a WODirect action with code such as
this:
// set object ID for Selected page
Application anApp = Application.myApplication();
anApp.setTbJobPicID( (String)this.request().formValueForKey
( "tbJobPicID" ) );
but now I am using state and can not think how to extract it as the
Direct action code would not work in this method that I am trying to
get the ID from:
public WOComponent dbAddTbJobLinkToClientRelationship() {
// get editing context
EOEditingContext ec = session().defaultEditingContext();
// create new tbJob object
TbJob newTbJob = new TbJob();
newTbJob.setTextAboutJob("Sorry, information about this job
has not been entered yet");
// insert new tbJob into editing context
ec.insertObject(newTbJob);
// add new tbJob to tbJobs and set tbClient for it
tbClient.addObjectToBothSidesOfRelationshipWithKey
(newTbJob, "tbJobs");
setTbJobID(/*I want to get primary key here*/);
return null;
}
Can anone point me in the right direction?
Kind regards
Jonathan
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.