org.apache.ignite.cache.store.jdbc.dialect

## Class BasicJdbcDialect

- java.lang.Object
- - org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect

All Implemented Interfaces:
  JdbcDialect

Direct Known Subclasses:
  DB2Dialect, H2Dialect, MySQLDialect, OracleDialect, SQLServerDialect

    public class BasicJdbcDialect
    extends Object
    implements JdbcDialect

Represents a dialect of SQL implemented by a particular RDBMS.

### Field Summary

Fields
`protected static int` `DFLT_MAX_PARAMS_CNT` Default max query parameters count.
`protected int` `maxParamsCnt` Max query parameters count.

### Constructor Summary

Constructors
Constructor and Description
`BasicJdbcDialect()`

### Method Summary

Methods
`int` `getMaxParamsCnt()` Get max query parameters count.
`boolean` `hasMerge()`
`String` `insertQuery(String fullTblName, Collection<String> keyCols, Collection<String> valCols)` Construct insert query.
`String` `loadCacheQuery(String fullTblName, Iterable<String> uniqCols)` Construct load cache query.
`String` `loadCacheRangeQuery(String fullTblName, Collection<String> keyCols, Iterable<String> uniqCols, boolean appendLowerBound, boolean appendUpperBound)` Construct select count query.
`String` `loadCacheSelectRangeQuery(String fullTblName, Collection<String> keyCols)` Construct select count query.
`String` `loadQuery(String fullTblName, Collection<String> keyCols, Iterable<String> cols, int keyCnt)` Construct load query.
`String` `mergeQuery(String fullTblName, Collection<String> keyCols, Collection<String> uniqCols)` Construct merge query.
`protected static String` `mkString(Iterable<String> strs, String sep)` Concatenates strings using provided separator.
`protected static String` `mkString(Iterable<String> strs, String start, String sep, String end)` Concatenates elements using provided separator.
`protected static <T> String` `mkString(Iterable<T> elems, C1<T,String> f, String start, String sep, String end)` Concatenates elements using provided separator.
`String` `removeQuery(String fullTblName, Iterable<String> keyCols)` Construct remove query.
`protected static String` `repeat(String str, int cnt, String start, String sep, String end)` Concatenates elements using provided delimiter.
`void` `setMaxParamsCnt(int maxParamsCnt)` Set max query parameters count.
`String` `updateQuery(String fullTblName, Collection<String> keyCols, Iterable<String> valCols)` Construct update query.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DFLT_MAX_PARAMS_CNT

    protected static final int DFLT_MAX_PARAMS_CNT

Default max query parameters count.

See Also:
  Constant Field Values

#### maxParamsCnt

    protected int maxParamsCnt

Max query parameters count.

### Constructor Detail

#### BasicJdbcDialect

    public BasicJdbcDialect()

### Method Detail

#### mkString

    protected static <T> String mkString(Iterable<T> elems,
                      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.

#### mkString

    protected 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.

#### mkString

    protected static String mkString(Iterable<String> strs,
                  String sep)

Concatenates strings using provided separator.

Parameters:
  `strs` - Concatenated string.
  `sep` - Separator.
Returns:
  Concatenated string.

#### repeat

    protected 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.

#### loadCacheSelectRangeQuery

    public String loadCacheSelectRangeQuery(String fullTblName,
                                   Collection<String> keyCols)

Construct select count query.

Specified by:
  `loadCacheSelectRangeQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `keyCols` - Database key columns for order.
Returns:
  Query for select count.

#### loadCacheRangeQuery

    public String loadCacheRangeQuery(String fullTblName,
                             Collection<String> keyCols,
                             Iterable<String> uniqCols,
                             boolean appendLowerBound,
                             boolean appendUpperBound)

Construct select count query.

Specified by:
  `loadCacheRangeQuery` in 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.

#### loadCacheQuery

    public String loadCacheQuery(String fullTblName,
                        Iterable<String> uniqCols)

Construct load cache query.

Specified by:
  `loadCacheQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `uniqCols` - Database unique value columns.
Returns:
  Load cache query.

#### loadQuery

    public String loadQuery(String fullTblName,
                   Collection<String> keyCols,
                   Iterable<String> cols,
                   int keyCnt)

Construct load query.

Specified by:
  `loadQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `keyCols` - Database key columns.
  `cols` - Selected columns.
  `keyCnt` - Key count.
Returns:
  Load query.

#### insertQuery

    public String insertQuery(String fullTblName,
                     Collection<String> keyCols,
                     Collection<String> valCols)

Construct insert query.

Specified by:
  `insertQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `keyCols` - Database key columns.
  `valCols` - Database value columns.

#### updateQuery

    public String updateQuery(String fullTblName,
                     Collection<String> keyCols,
                     Iterable<String> valCols)

Construct update query.

Specified by:
  `updateQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `keyCols` - Database key columns.
  `valCols` - Database value columns.

#### hasMerge

    public boolean hasMerge()

Specified by:
  `hasMerge` in interface `JdbcDialect`
Returns:
  `True` if database support merge operation.

#### mergeQuery

    public String mergeQuery(String fullTblName,
                    Collection<String> keyCols,
                    Collection<String> uniqCols)

Construct merge query.

Specified by:
  `mergeQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `keyCols` - Database key columns.
  `uniqCols` - Database unique value columns.
Returns:
  Put query.

#### removeQuery

    public String removeQuery(String fullTblName,
                     Iterable<String> keyCols)

Construct remove query.

Specified by:
  `removeQuery` in interface `JdbcDialect`
Parameters:
  `fullTblName` - Full table name.
  `keyCols` - Database key columns.
Returns:
  Remove query.

#### getMaxParamsCnt

    public int getMaxParamsCnt()

Get max query parameters count.

Specified by:
  `getMaxParamsCnt` in interface `JdbcDialect`
Returns:
  Max query parameters count.

#### setMaxParamsCnt

    public void setMaxParamsCnt(int maxParamsCnt)

Set max query parameters count.

Parameters:
  `maxParamsCnt` - Max query parameters count.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015