Documentation Archive Developer
Search
PATH Documentation > WebObjects

Up Previous Next

Setting a WODisplayGroup's Fetch Specification Programmatically

Synopsis

Describes how you use a programmatically-generated EOFetchSpecification with a WODisplayGroup.

Description

A WODisplayGroup does not actually maintain a fetch specification; this is the job of the display group's EODatabaseDataSource. The Creating a WODisplayGroup programming topic contains more information about the EODatabaseDataSource. WebObjects provides two nonprogrammatic ways to set this fetch specification.

If you use Project Builder's wizard to create a component with a display group, the fetch specification is created based on the display group's queryMatch dictionary using the qualifyDataSource method. See the WODisplayGroup class specification in the WebObjects Framework Reference for more information about the queryMatch dictionary.

You can also create a fetch specification using EOModeler's fetch specification builder. You associate this fetch specification with the display group using WebObjects Builder's display group configuration panel. See "Working With Fetch Specifications" in Enterprise Objects Framework Tools and Techniques and "Configuring the Display Group" in WebObjects Framework Tools and Techniques for more information.

However, sometimes you need to create the fetch specification programmatically. For example, to perform a keyword search with an unlimited number of keywords, you must build the qualifier dynamically. To get the WODisplayGroup to fetch using such a fetch specification you need to send the EODatabaseDataSource the fetch specification as shown in the following Java code.

 
WODisplayGroup dg;       // assume this existsEOFetchSpecification fs; // assume this exists// Get the EODatabaseDataSourceEODatabaseDataSource ds = (EODatabaseDataSource)dg.dataSource();// Set the fetch specificationds.setFetchSpecification(fs);// Fetch the objectsdg.fetch();

See Also

Questions

Keywords

Revision History

19 February 1999. Clif Liu. First Draft.


© 1999 Apple Computer, Inc.

Up Previous Next[an error occurred while processing this directive]