• 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
FetchSpec setFetchLimit??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FetchSpec setFetchLimit??


  • Subject: FetchSpec setFetchLimit??
  • From: Kieran Kelleher <email@hidden>
  • Date: Mon, 2 Mar 2009 16:42:50 -0500

I always thought that EOFetchSpecification.setFetchLimit( int n) would generate SQL with LIMIT n tacked onto the end of the SQL statement, but it appears not to. Instead it fetches the all qualifying records and does the LIMIT in memory?! Has this always been the case .... or is it just the MySQL driver?

For example:

<snip>
// Fetch the most recent shipped message
ERXSortOrderings s = CTMessage.XKEY_OID.descs();

ERXFetchSpecification<CTMessage> fs = new ERXFetchSpecification<CTMessage>(CTMessage.ENTITY_NAME,null,s);

fs.setFetchLimit(1);

System.out.println("MailingAddressUtilitiesTests.suppressionTest(): fs.SQL = " + ERXEOAccessUtilities.sqlForFetchSpecification(ec, fs));

NSArray<CTMessage> objects = fs.fetchObjects(ec);
</snip>


..... generates the following SQL without "LIMIT 1" !!!

SELECT t0.oid, t0.oidcampaign, t0.oiddatarecord, t0.oidjob, t0.oidlocation, t0.oidmediatemplate, t0.recaddtime, t0.recadduser, t0.recmodtime, t0.recmoduser, RTRIM(t0.workflowstate) FROM message t0 ORDER BY t0.oid DESC;
_______________________________________________
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
  • Follow-Ups:
    • Re: FetchSpec setFetchLimit??
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Memory Management (or rather documenting thereof...)
  • Next by Date: Re: Memory Management (or rather documenting thereof...)
  • Previous by thread: Re: Current EOGenerator Templates
  • Next by thread: Re: FetchSpec setFetchLimit??
  • Index(es):
    • Date
    • Thread