public interface SqlDialect
Note: The implementation MUST BE state-less and thread-safe because one instance parse all queries from one
Repository.
| Modifier and Type | Method and Description |
|---|---|
SqlFeature |
addFeature(SqlFeature sqlFeature)
Override a SQL ANSI feature
|
String |
buildQueryCount(String sqlText)
Build a paginate query to count the total of records from
sqlText |
String |
buildQueryPaging(String sqlText,
int offset,
int max)
Build a paginate query accordingly data base dialect
|
String |
buildQueryPaging(String sqlText,
int offset,
int max,
String bookmark)
Build a paginate query accordingly data base dialect
|
PropertyAccess |
getAccessId()
The access name for
id field, the identifier from an entity |
PropertyAccess |
getAccessRevision()
The access name for
revision field, a revision number from an entity |
int |
getMaxOfParameters()
Return the limit of elements in an
INPUT parameter the database supports. |
String |
getSqlPatternCount()
The template to mount the
COUNT SQL |
String |
getSqlPatternPaging()
The template to mount the SQL paginated, using LIMIT and OFFSET
clauses according the specific database
|
String |
name()
Dialect name
|
void |
setMaxOfParameters(int max)
Max number of parameters supported by JDBC driver
|
boolean |
supportsFeature(SqlFeatureSupport feature)
verify if dialect instance supports
feature specified |
boolean |
supportsParmMark(ParamMarkType paramParse)
verify if dialect supports a specific
ParamMarkType |
boolean supportsFeature(SqlFeatureSupport feature)
feature specifiedfeature - to checktrue when the dialect supports, false otherwiseboolean supportsParmMark(ParamMarkType paramParse)
ParamMarkTypeparamParse - parameter mark typetrue when the parse type is supported, false otherwiseSqlFeature addFeature(SqlFeature sqlFeature)
sqlFeature - override a SqlFeature supports.sqlFeatureint getMaxOfParameters()
INPUT parameter the database supports.Integer.MAX_VALUEvoid setMaxOfParameters(int max)
max - maximum value of parameter in the queryString getSqlPatternCount()
COUNT SQLselect count(1) from (%1$s) _alias_internal_table_String getSqlPatternPaging()
%1$s LIMIT %2$s, %3$sString buildQueryPaging(String sqlText, int offset, int max)
sqlText - final SQL with parameters to bindoffset - number from first row from query resultmax - maximum number of rows from query result.String buildQueryPaging(String sqlText, int offset, int max, String bookmark)
sqlText - final SQL with parameters to bindoffset - number from first row from query resultmax - maximum number of rows from query result.bookmark - a page selected marked the reader's placeString buildQueryCount(String sqlText)
sqlTextsqlText - original SQL to discover the total of recordssqlTextPropertyAccess getAccessId()
id field, the identifier from an entityid, getId, setIdPropertyAccess getAccessRevision()
revision field, a revision number from an entityrev, getRev, setRevCopyright © 2012–2020 jkniv, copyleft code. All rights reserved.