site_archiver@lists.apple.com Delivered-To: webobjects-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=gMxfqD16BHIUAXZ+D7aHp4w5DbTq4WGoOPdoL1amoh0V4CyF9hLNFbgJq6WS6Q/QJGPsXC/G4JtrZqu7Cb2SrnVNK8yL7Z4hR33lwtM1wneVDgr2awfZqVy79tjwGm+0R6dWS7CC36q/U7GH8rRwqmkTW/SbDf+chcbiuEfKnqg= On Feb 01, 2005, at 20:10, Chuck Hill wrote: public class EFCount extends EFSelect { private static final String Count = "COUNT(*)"; protected String attributesDescription() { return EFCount.Count; } public int count() throws SQLException { Iterator anIterator = this.execute(); int aCount = 0; if ( aNumber.intValue() > 0 ) { aCount = aNumber.intValue(); } } this.close(); return aCount; } } Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/site_archiver%40lists.... Here are some other counting implementation that I have gleaned from the list. Perhaps they are of interest? Perhaps... or perhaps you could use the hidden power of raw <gasp>JDBC</gasp> instead: // ======================================================================== === // Constant(s) // ------------------------------------------------------------------------ --- // ======================================================================== === // Class variable(s) // ------------------------------------------------------------------------ --- // ======================================================================== === // Instance variable(s) // ------------------------------------------------------------------------ --- // ======================================================================== === // Constructor method(s) // ------------------------------------------------------------------------ --- public EFCount(final DataSource aDataSource, final Class anEntity, final SZQualifier aQualifier) { super( aDataSource, anEntity, aQualifier, null ); } // ======================================================================== === // Class method(s) // ------------------------------------------------------------------------ --- // ======================================================================== === // Instance method(s) // ------------------------------------------------------------------------ --- // ======================================================================== === // EFAction method(s) // ------------------------------------------------------------------------ --- if ( anIterator.hasNext() == true ) { Map someValues = (Map) anIterator.next(); Number aNumber = (Number) someValues.values().iterator().next(); This email sent to site_archiver@lists.apple.com
participants (1)
-
PA