On Jul 21, 2009, at 12:56 AM, Francesco Romano wrote:

Hi..
This is a simple (and maybe stupid) question.

No.  :-)


I'm doing an application (an e-commerce application.. maybe wo is not the best choice, but I know java better than ruby..), and I've some pages accessed with directaction. Maybe I'm wrong, but I can pass values to a page only with the url, so.. only strings.
In a page I select an EntityObject and I've to pass to the other page.
If I can't pass the whole object, I would like to pass the primary key, so fetching should be faster..
But.. I can get the key, but I can't fetch an Object with it's PK.

Yes, you can.  See the EOUtilities class in the EOAccess package:
http://developer.apple.com/documentation/MacOSXServer/Reference/WO54_Reference/com/webobjects/eoaccess/EOUtilities.html#faultWithPrimaryKeyValue(com.webobjects.eocontrol.EOEditingContext,%20java.lang.String,%20java.lang.Object)

public static EOEnterpriseObject faultWithPrimaryKeyValue(EOEditingContext ec, String entityName, Object value) Fetches the Enterprise Object identified by the specified primary key value


Now i pass a name (a description string..).. but it's not unique, so even with low probability, there can be collisions..

What can I do?


If the PK is the only unique value, you have to use it or create some other unique value.


Chuck

--
Chuck Hill             Senior Consultant / VP Development

Learn WO at WOWODC'09 East in Montréal this August!
http://www.wocommunity.org/wowodc09/east

http://arstechnica.com/apple/news/2009/07/webobjects-sliced-from-106but-prognosis-of-death-premature.ars

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to