Re: Displaying Primary Keys
Re: Displaying Primary Keys
- Subject: Re: Displaying Primary Keys
- From: Robert Walker <email@hidden>
- Date: Fri, 26 Dec 2003 13:35:42 -0500
Drew,
Take a look at the EOUtilities.primaryKeyForObject() method in the
com.webobjects.eoaccess package.
This convenience method returns a dictionary containing the entire
primary key for the object. So if your primary key is a single
attribute named "oid" then get the value from the dictionary by calling
objectForKey("oid").
On Dec 26, 2003, at 8:54 AM, 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.
}
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.
--
Sincerely,
Robert Walker
_______________________________________________
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.