PATH |
Describes how you use a programmatically-generated EOFetchSpecification with a WODisplayGroup.
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();