com.github.drinkjava2.jdialects
Interface CommonDialect

All Known Implementing Classes:
Dialect

public interface CommonDialect

Interface for Dialect, usually used to eliminate POM dependency for other projects

Since:
1.0.0
Author:
Yong Zhu

Method Summary
 String pagin(int pageNumber, int pageSize, String sql)
          Create a pagination SQL by given pageNumber, pageSize and SQL
 String paginAndTrans(int pageNumber, int pageSize, String... sql)
          Paginate and Translate a SQL
 String trans(String... sql)
          Translate a SQL to native SQL, i.e., all functions written by universal function format will be transfer to a native SQL function, for example, concat('a','b') in some dialects will be changed to 'a'+'b'
 

Method Detail

pagin

String pagin(int pageNumber,
             int pageSize,
             String sql)
Create a pagination SQL by given pageNumber, pageSize and SQL

Parameters:
pageNumber - The page number, start from 1
pageSize - The page item size
sql - The original SQL
Returns:
The paginated SQL

trans

String trans(String... sql)
Translate a SQL to native SQL, i.e., all functions written by universal function format will be transfer to a native SQL function, for example, concat('a','b') in some dialects will be changed to 'a'+'b'

Parameters:
sql - array
Returns:
the translated SQL

paginAndTrans

String paginAndTrans(int pageNumber,
                     int pageSize,
                     String... sql)
Paginate and Translate a SQL

Parameters:
The - page number, start from 1
pageSize - The page item size
sql - The original SQL
Returns:
The paginated and translated SQL


Copyright © 2018. All rights reserved.