• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Size of fetched array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of fetched array


  • Subject: Re: Size of fetched array
  • From: Kieran Kelleher <email@hidden>
  • Date: Mon, 27 May 2013 12:00:18 -0400

IIRC, not all of the database plugins support limiting the number of rows to be fetched in SQL. Both MySQL and PostgreSQL support fetchLimit, and additionally the fetchRange (SQL paging ... LIMIT, OFFSET) of ERXFetchSpecification. If using some other database, just check the plugin's *Expression class assembleSelectStatementWithAttributes(...) method source code (or javadoc)

On May 27, 2013, at 6:06 AM, Johann Werner <email@hidden> wrote:

> Hi Thomas,
>
> you would use a fetch spec for that where you can set a limit.
>
> EOFetchSpecification fs = …
> fs.setFetchLimit(10);
> NSArray<MaintenanceJob> doubleJobs = ec.objectsWithFetchSpecification(fs);
>
>
> jw
>
>
> Am 27.05.2013 um 11:59 schrieb Thomas Grass (01SoftwareSolutions) <email@hidden>:
>
>> Hello WO-Coders,
>>
>> I fetch objects with special bindings like the following example:
>>
>> [...]
>> NSMutableDictionary<String, Object> bindings = new NSMutableDictionary<String, Object>();
>> 	if(selectedJob.description()!=null) bindings.setObjectForKey(selectedJob.description(), "description");
>>   	if(selectedJob.validSystem()!=null) bindings.setObjectForKey(selectedJob.validSystem(), "validSystem");
>>   	if(selectedJob.component()!=null) bindings.setObjectForKey(selectedJob.component(), "component");
>>   	if(selectedJob.subComponent()!=null) bindings.setObjectForKey(selectedJob.subComponent(), "subComponent");
>>   	NSArray<MaintenanceJob> doubleJobs = MaintenanceJob.fetchForDoubleCheck(session.defaultEditingContext(), bindings);
>> […]
>>
>> Is there a way to tell the fetch-Method the max number of objects to be fetched? For example: 10 Objects?
>>
>> Thomas
>>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Size of fetched array (From: "Thomas Grass (01SoftwareSolutions)" <email@hidden>)
 >Re: Size of fetched array (From: Johann Werner <email@hidden>)

  • Prev by Date: Re: Size of fetched array
  • Next by Date: Eclipse deployment checkboxes won't recognize Projects.
  • Previous by thread: Re: Size of fetched array
  • Next by thread: Eclipse deployment checkboxes won't recognize Projects.
  • Index(es):
    • Date
    • Thread