Re: Displaying Primary Keys
Re: Displaying Primary Keys
- Subject: Re: Displaying Primary Keys
- From: Kaj Hejer <email@hidden>
- Date: Fri, 26 Dec 2003 18:25:08 +0100
At 08:54 -0500 26-12-03, 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.
}
Hi!
You should never have the foreign key as attributes in the EO class,
but if you need to display you can include the primary key. That is
not that bad :)
If you don't want to have the primary key as attrinute in your EO
class you can use the following method from
com.webobjects.eoacces.EOUtilities:
public static NSDictionary primaryKeyForObject(EOEditingContext ec,
EOEnterpriseObject object)
-Kaj :)
_______________________________________________
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.