ca.krasnay.sqlbuilder
Class PostgresqlDialect

java.lang.Object
  extended by ca.krasnay.sqlbuilder.PostgresqlDialect
All Implemented Interfaces:
Dialect, Serializable

public class PostgresqlDialect
extends Object
implements Dialect, Serializable

Dialect for PostgreSQL.

Author:
John Krasnay
See Also:
Serialized Form

Constructor Summary
PostgresqlDialect()
           
 
Method Summary
 String createCountSelect(String sql)
          Returns a SQL statement that returns the number of rows that would be returned by another select.
 String createPageSelect(String sql, int limit, int offset)
          Returns a SQL statement that returns a limited number of rows from an inner query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgresqlDialect

public PostgresqlDialect()
Method Detail

createCountSelect

public String createCountSelect(String sql)
Description copied from interface: Dialect
Returns a SQL statement that returns the number of rows that would be returned by another select.

Specified by:
createCountSelect in interface Dialect
Parameters:
sql - Inner select statement, i.e. the one that returns the rows themselves.

createPageSelect

public String createPageSelect(String sql,
                               int limit,
                               int offset)
Description copied from interface: Dialect
Returns a SQL statement that returns a limited number of rows from an inner query. Note that the inner select should include an ORDER BY clause that strictly orders the result set; otherwise, some database servers may return pages inconsistently.

Specified by:
createPageSelect in interface Dialect
Parameters:
sql - Inner query that would return the full result set.
limit - Maximum number of rows to return.
offset - Index into the result set of the first row returned.


Copyright © 2014. All rights reserved.