RE: Displaying Primary Keys
RE: Displaying Primary Keys
- Subject: RE: Displaying Primary Keys
- From: "Jonathan Fleming" <email@hidden>
- Date: Fri, 26 Dec 2003 17:19:05 +0000
Hi Drew,
best place to use this is from your custom java class( your business logic)
Try this,
import com.apple.yellow.eoaccess.*; // IMPORTANT, required for this
method to work
public Number desiredPrimaryKey() {
NSDictionary keyDict = EOUtilities.primaryKeyForObject(
this.editingContext(), this);
return (Number)keyDict.objectForKey("desiredPrimaryKey");
}
You might need to use "valueForKey" and not "objectForKey"???
Jonathan :^)
From: Drew Thoeni <email@hidden>
To: email@hidden
Subject: Displaying Primary Keys
Date: Fri, 26 Dec 2003 08:54:22 -0500
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.
}
public Answer newbieQuestion() {
What is the proper way to do this? Any references out there you suggest.
}
_______________________________________________
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.
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
_______________________________________________
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.