Re: Getting an abstract ID key - how?
Re: Getting an abstract ID key - how?
- Subject: Re: Getting an abstract ID key - how?
- From: George Domurot <email@hidden>
- Date: Sat, 1 Feb 2003 16:47:52 -0500
Place this method in your object to have it return its PK:
import com.webobjects.eoaccess.EOUtilities;
public Number primaryKey(){
try{
NSDictionary primaryKeys =
EOUtilities.primaryKeyForObject(editingContext(),
(EOEnterpriseObject)this);
NSArray keyValues = primaryKeys.allValues();
return (Number)keyValues.objectAtIndex(0);
} catch (Exception e){
return (Number)(new Integer(0));
}
}
##
_______________________________________________
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.