site_archiver@lists.apple.com Delivered-To: webobjects-dev@lists.apple.com Hi there, do follow Zak's suggestion... Example (without exception handling, action methods, etc) snippets... pkey = new Integer(userInputKey); HTH somewhat... with regards, -- Lachlan Deck _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/site_archiver%40lists.... You might also like to look at... http://developer.apple.com/documentation/WebObjects/ http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/ index.html And various helpful Programming Topics linked from the Legacy Docs (strangely not from the current docs): http://developer.apple.com/documentation/LegacyTechnologies/WebObjects/ WebObjects_5/Topics/TopicsTOC.html an example [fetch] code is greatly appriciated... So, I assume that you've made Attribute myID the primary key (Key Symbol in EOModeler) and is also available as a class attribute (Diamond symbol). Your myValue attribute will just have the diamond. Then you've exported the java class. Fetching the values is really going to depend on how else you're dealing with the fetched object(s) (i.e., rows) if at all. Can the user see a list of available keys, for example? If yes, then it'll make more sense to do in-memory filtering (see first link above) on the objects you have already fetched. If no, raw row fetching could make better sense (see both links). etc etc You'll need to decide how you are using the data, whether the user can edit the objects etc. After you've gone through the tutorial Zak mentioned (make sure you understand the concepts there), then the below may make more sense... // in-memory filter example snippet kvq = new EOKeyValueQualifier("myID", EOQualifier.QualifierOperatorEqual, pkey); filteredArray = EOQualifier.filteredArrayWithQualifier(fetchedEntities, kvq); if (...) { selectedEntity = filteredArray.objectAtIndex(0); } // _or_ // EOUtilities fetch example snippet selectedEntity = (T_TEST)EOUtilities.objectWithPrimaryKeyValue(ec, "T_TEST", pkey); This email sent to site_archiver@lists.apple.com
participants (1)
-
LD