incubator-empire-db-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <doeb...@esteam.de>
Subject re: Limit Offset clause
Date Tue, 07 Jul 2009 07:43:29 GMT
Hi Frank,

the correct approach for this is to extend the class DBCommandPostreSQL that you already have
as a nested class in DBDatabaseDriverPostgreSQL.

I recommend to promote it to a normal class and then implement the following:
- create getters/setters to set the limit.
- override getSelect(StringBuilder buf) from the base class (DBCommand) in order to add the
limits to the SQL.

In order to use it, however you have to cast the command object returned by DBDatabase.createCommand()
to a DBDatabaseDriverPostgreSQL object, which will make your code PostgreSQL specific. 

We've done similar things with the Oracle command object (see DBCommandOracle).

If it works we would be happy to provide the code with a future release.

Regards
Rainer


Frank Lupo wrote:
> Betreff: Limit Offset clause
> 
> In DBDatabaseDriver is possible to implementig SQL_LIMIT and SQL_OFFSET
> for pagination resul using DBCommand?
> Es. in DBDatabaseDriverPostgreSQL
> SQL_LIMIT = "LIMIT {0}"
> SQL_OFFSET= "OFFSET {0}"
> in DBCommand get/set Limt and Offset
> 
> 
> 
> 
>  --
>  Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e
> SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
> 
>  Sponsor:
>  RIVIERA PARK HOTELS:
> * Cerchi un hotel per visitare i parchi della Romagna ? Oltremare,
> Aquafan, Mirabilandia e Fiabilandia ti aspettano. Scegli un
> RivieraParkHotels  per la tua vacanza a Riccione.
>  Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=9280&d=7-7

Mime
View raw message