Class BasicJdbcDialect
- java.lang.Object
- 
- org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect
 
- 
- All Implemented Interfaces:
- Serializable,- JdbcDialect
 - Direct Known Subclasses:
- DB2Dialect,- H2Dialect,- MySQLDialect,- OracleDialect,- SQLServerDialect
 
 public class BasicJdbcDialect extends Object implements JdbcDialect Basic implementation of dialect based on JDBC specification.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static intDFLT_MAX_PARAMS_CNTDefault max query parameters count.protected intfetchSizeFetch size.protected intmaxParamsCntMax query parameters count.
 - 
Constructor SummaryConstructors Constructor Description BasicJdbcDialect()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringescape(String ident)intgetFetchSize()Gives the JDBC driver a hint how many rows should be fetched from the database when more rows are needed.intgetMaxParameterCount()Get max query parameters count.booleanhasMerge()StringinsertQuery(String fullTblName, Collection<String> keyCols, Collection<String> valCols)Construct insert query.StringloadCacheQuery(String fullTblName, Iterable<String> uniqCols)Construct load cache query.StringloadCacheRangeQuery(String fullTblName, Collection<String> keyCols, Iterable<String> uniqCols, boolean appendLowerBound, boolean appendUpperBound)Construct load cache query over specified range.StringloadCacheSelectRangeQuery(String fullTblName, Collection<String> keyCols)Construct query to get ranges bounds.StringloadQuery(String fullTblName, Collection<String> keyCols, Iterable<String> cols, int keyCnt)Construct load query.StringmergeQuery(String fullTblName, Collection<String> keyCols, Collection<String> uniqCols)Construct merge query.protected static StringmkString(Iterable<String> strs, String sep)Concatenates strings using provided separator.protected static StringmkString(Iterable<String> strs, String start, String sep, String end)Concatenates elements using provided separator.protected static <T> StringmkString(Iterable<T> elems, org.apache.ignite.internal.util.typedef.C1<T,String> f, String start, String sep, String end)Concatenates elements using provided separator.StringremoveQuery(String fullTblName, Iterable<String> keyCols)Construct remove query.protected static Stringrepeat(String str, int cnt, String start, String sep, String end)Concatenates elements using provided delimiter.voidsetFetchSize(int fetchSize)Sets fetch size.voidsetMaxParameterCount(int maxParamsCnt)Set max query parameters count.StringupdateQuery(String fullTblName, Collection<String> keyCols, Iterable<String> valCols)Construct update query.
 
- 
- 
- 
Field Detail- 
DFLT_MAX_PARAMS_CNTprotected static final int DFLT_MAX_PARAMS_CNT Default max query parameters count.- See Also:
- Constant Field Values
 
 - 
maxParamsCntprotected int maxParamsCnt Max query parameters count.
 - 
fetchSizeprotected int fetchSize Fetch size.
 
- 
 - 
Method Detail- 
mkStringprotected static <T> String mkString(Iterable<T> elems, org.apache.ignite.internal.util.typedef.C1<T,String> f, String start, String sep, String end) Concatenates elements using provided separator.- Parameters:
- elems- Concatenated elements.
- f- closure used for transform element.
- start- Start string.
- sep- Separator.
- end- End string.
- Returns:
- Concatenated string.
 
 - 
mkStringprotected static String mkString(Iterable<String> strs, String start, String sep, String end) Concatenates elements using provided separator.- Parameters:
- strs- Concatenated string.
- start- Start string.
- sep- Delimiter.
- end- End string.
- Returns:
- Concatenated string.
 
 - 
mkStringprotected static String mkString(Iterable<String> strs, String sep) Concatenates strings using provided separator.- Parameters:
- strs- Concatenated string.
- sep- Separator.
- Returns:
- Concatenated string.
 
 - 
repeatprotected static String repeat(String str, int cnt, String start, String sep, String end) Concatenates elements using provided delimiter.- Parameters:
- str- Repeated string.
- cnt- Repeat count.
- start- Start string.
- sep- Separator.
- end- End string.
 
 - 
escapepublic String escape(String ident) - Specified by:
- escapein interface- JdbcDialect
- Parameters:
- ident- SQL identifier to escape.
- Returns:
- Escaped SQL identifier.
 
 - 
loadCacheSelectRangeQuerypublic String loadCacheSelectRangeQuery(String fullTblName, Collection<String> keyCols) Construct query to get ranges bounds.- Specified by:
- loadCacheSelectRangeQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns for order.
- Returns:
- Query for select count.
 
 - 
loadCacheRangeQuerypublic String loadCacheRangeQuery(String fullTblName, Collection<String> keyCols, Iterable<String> uniqCols, boolean appendLowerBound, boolean appendUpperBound) Construct load cache query over specified range.- Specified by:
- loadCacheRangeQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns for order.
- uniqCols- Database unique value columns.
- appendLowerBound- Need add lower bound for range.
- appendUpperBound- Need add upper bound for range.
- Returns:
- Query for select count.
 
 - 
loadCacheQuerypublic String loadCacheQuery(String fullTblName, Iterable<String> uniqCols) Construct load cache query.- Specified by:
- loadCacheQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- uniqCols- Database unique value columns.
- Returns:
- Load cache query.
 
 - 
loadQuerypublic String loadQuery(String fullTblName, Collection<String> keyCols, Iterable<String> cols, int keyCnt) Construct load query.- Specified by:
- loadQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns.
- cols- Selected columns.
- keyCnt- Key count.
- Returns:
- Load query.
 
 - 
insertQuerypublic String insertQuery(String fullTblName, Collection<String> keyCols, Collection<String> valCols) Construct insert query.- Specified by:
- insertQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns.
- valCols- Database value columns.
- Returns:
- Insert query.
 
 - 
updateQuerypublic String updateQuery(String fullTblName, Collection<String> keyCols, Iterable<String> valCols) Construct update query.- Specified by:
- updateQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns.
- valCols- Database value columns.
- Returns:
- Update query.
 
 - 
hasMergepublic boolean hasMerge() - Specified by:
- hasMergein interface- JdbcDialect
- Returns:
- Trueif database support merge operation.
 
 - 
mergeQuerypublic String mergeQuery(String fullTblName, Collection<String> keyCols, Collection<String> uniqCols) Construct merge query.- Specified by:
- mergeQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns.
- uniqCols- Database unique value columns.
- Returns:
- Merge query.
 
 - 
removeQuerypublic String removeQuery(String fullTblName, Iterable<String> keyCols) Construct remove query.- Specified by:
- removeQueryin interface- JdbcDialect
- Parameters:
- fullTblName- Full table name.
- keyCols- Database key columns.
- Returns:
- Remove query.
 
 - 
getMaxParameterCountpublic int getMaxParameterCount() Get max query parameters count.- Specified by:
- getMaxParameterCountin interface- JdbcDialect
- Returns:
- Max query parameters count.
 
 - 
setMaxParameterCountpublic void setMaxParameterCount(int maxParamsCnt) Set max query parameters count.- Parameters:
- maxParamsCnt- Max query parameters count.
 
 - 
getFetchSizepublic int getFetchSize() Gives the JDBC driver a hint how many rows should be fetched from the database when more rows are needed. If the value specified is zero, then the hint is ignored. The default value is zero.- Specified by:
- getFetchSizein interface- JdbcDialect
- Returns:
- The fetch size for result sets.
 
 - 
setFetchSizepublic void setFetchSize(int fetchSize) Sets fetch size.- Parameters:
- fetchSize- Fetch size.
 
 
- 
 
-