Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 50000 invoked from network); 29 May 2006 14:06:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 May 2006 14:06:08 -0000 Received: (qmail 72493 invoked by uid 500); 29 May 2006 14:06:06 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 72445 invoked by uid 500); 29 May 2006 14:06:06 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 72400 invoked by uid 99); 29 May 2006 14:06:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2006 07:06:05 -0700 X-ASF-Spam-Status: No, hits=1.0 required=10.0 tests=DNS_FROM_RFC_ABUSE,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [207.107.233.227] (HELO e2kmtl1.internal.sungard.corp) (207.107.233.227) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2006 07:06:03 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: setLimit() for Sybase. Content-Transfer-Encoding: quoted-printable Date: Mon, 29 May 2006 10:05:41 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: setLimit() for Sybase. Thread-Index: AcZ+nB9I5X9uIgouS3OFTpEuaUd2GQEd4wCAAAVN0cA= From: To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Here's the patch (the attachment didn't make it through): =3D=3D Index: C:/Program Files/eclipse/workspace/Torque-3.2-Runtime/src/java/org/apache/torque/ut il/LimitHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- C:/Program Files/eclipse/workspace/Torque-3.2-Runtime/src/java/org/apache/torque/ut il/LimitHelper.java (revision 348959) +++ C:/Program Files/eclipse/workspace/Torque-3.2-Runtime/src/java/org/apache/torque/ut il/LimitHelper.java (working copy) @@ -69,6 +69,9 @@ case DB.LIMIT_STYLE_DB2 : LimitHelper.generateDB2Limits(query, offset, limit); break; + case DB.LIMIT_STYLE_SYBASE : + LimitHelper.generateSybaseLimits(query, offset, limit); + break; default: if (db.supportsNativeLimit()) { @@ -113,6 +116,19 @@ } =20 /** + * Modify a query to add limit and offset values for Sybase. + * + * @param query The query to modify + * @param offset the offset Value + * @param limit the limit Value + */ + private static final void generateSybaseLimits(Query query, + int offset, int limit) + { + query.setRowcount(String.valueOf(limit+offset)); + } + =20 + /** * Generate a LIMIT limit OFFSET offset clause if offset > 0 * or an LIMIT limit clause if limit is > 0 and offset * is 0. =3D=3D -----Original Message----- From: Martin.Goulet@sungard.com [mailto:Martin.Goulet@sungard.com]=20 Sent: Monday, May 29, 2006 7:42 AM To: torque-dev@db.apache.org Subject: RE: setLimit() for Sybase. Hi Thomas, Based on this: http://mail-archives.apache.org/mod_mbox/db-torque-dev/200301.mbox/%3CF3 2mJPtNuY0NlzrZc7p00016fc0@hotmail.com%3E I suggest that LimitHelper.java be modified according to the attached patch. Let me know what you think. MG -----Original Message----- From: Thomas Fischer [mailto:tfischer@apache.org]=20 Sent: Tuesday, May 23, 2006 3:06 PM To: Apache Torque Developers List Subject: Re: setLimit() for Sybase. I'd guess it was simply forgotten. If anyone has a patch, I'd be happy to=20 commit it, however, I canot test it because I do not have access to a=20 Sybase database. Thomas On Tue, 23 May 2006, Martin.Goulet@sungard.com wrote: > > > Hi all! > > > > I've noticed that the DB.java class contains the constant to define > limits (Criteria.setLimit() etc) for the Sybase database > (LIMIT_STYLE_SYBASE). However the LimitHelper.java class doesn't make > use of it (excerpt from the buidLimit method): > > > > ... > > if (offset > 0 || limit > 0) > > { > > // If we hit a database type, that is able to do native > > // limiting, we must set the criteria values to -1 and 0 > > // afterwards. Reason is, that else theexecuteQuery > > // method tries to do the limiting using Village > > // > > switch (db.getLimitStyle()) > > { > > case DB.LIMIT_STYLE_MYSQL : > > LimitHelper.generateMySQLLimits(query, offset, limit); > > break; > > case DB.LIMIT_STYLE_POSTGRES : > > LimitHelper.generatePostgreSQLLimits(query, offset, > limit); > > break; > > case DB.LIMIT_STYLE_ORACLE : > > LimitHelper.generateOracleLimits(query, offset, limit); > > break; > > case DB.LIMIT_STYLE_DB2 : > > LimitHelper.generateDB2Limits(query, offset, limit); > > break; > > default: > > if (db.supportsNativeLimit()) > > { > > query.setLimit(String.valueOf(limit)); > > } > > break; > > } > > ... > > > > You notice that there is no case for Sybase (DB.LIMIT_STYLE_SYBASE). Any > reason why? > > > > Any help would be most appreciated. > > > > Thx! > > > > MG > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org