db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Martin.Gou...@sungard.com>
Subject RE: setLimit() for Sybase.
Date Mon, 29 May 2006 11:42:11 GMT
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] 
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 
commit it, however, I canot test it because I do not have access to a 
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





Mime
View raw message