PATH |
Setting a Fetch Limit
Description
By default, when you fetch enterprise objects from a database, all objects that match the fetch criteria are returned. For large databases with lots of records, this can mean that users have to wait while all objects are fetched. To avoid this, you can limit the number of objects fetched.
Setting a Fetch Limit with EOModeler
You can set a fetch limit using the fetch specification builder in EOModeler:
Expand the entity containing the fetch specification you wish to limit.
Setting a Fetch Limit Programmatically
The EOFetchSpecification property fetchLimit and promptsAfterFetchLimit control the fetch limit behavior. To set the fetch limit you use the setFetchLimit method as shown in the following Java code.
EOFetchSpecification fs = new EOFetchSpecification("Movie",null,null); setFetchLimit(20); movieArray = this.session().defaultEditingContext(). objectsWithFetchSpecification(fs);
Revision History
4 May, 1998. Kelly Toshach. First Draft.
5 May, 1998. Greg Wilson. Added Synopsis, Questions, and Keywords.
© 1999 Apple Computer, Inc.