public class H2Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsColumn(List<IndexColumn> cols,
IndexColumn col) |
static boolean |
containsKeyColumn(GridH2RowDescriptor desc,
List<IndexColumn> cols)
Check whether columns list contains key or key alias column.
|
static Object |
convert(Object val,
GridH2RowDescriptor desc,
int type)
Convert value to column's expected type by means of H2.
|
static GridH2IndexBase |
createSpatialIndex(GridH2Table tbl,
String idxName,
IndexColumn[] cols)
Create spatial index.
|
static boolean |
equals(IndexColumn c1,
IndexColumn c2) |
static String |
indexCreateSql(String fullTblName,
GridH2IndexBase h2Idx,
boolean ifNotExists)
Generate
CREATE INDEX SQL statement for given params. |
static String |
indexDropSql(String schemaName,
String idxName,
boolean ifExists)
Generate
CREATE INDEX SQL statement for given params. |
static List<GridQueryFieldMetadata> |
meta(ResultSetMetaData rsMeta) |
static Session |
session(Connection c) |
static void |
setupConnection(Connection conn,
boolean distributedJoins,
boolean enforceJoinOrder) |
static List<IndexColumn> |
treeIndexColumns(GridH2RowDescriptor desc,
List<IndexColumn> cols,
IndexColumn keyCol,
IndexColumn affCol) |
static String |
withQuotes(String str)
Add quotes around the name.
|
static <any> |
zeroCursor() |
public static boolean equals(IndexColumn c1,
IndexColumn c2)
c1 - First column.c2 - Second column.true If they are the same.public static boolean containsColumn(List<IndexColumn> cols, IndexColumn col)
cols - Columns list.col - Column to find.true If found.public static boolean containsKeyColumn(GridH2RowDescriptor desc, List<IndexColumn> cols)
desc - Row descriptor.cols - Columns list.public static String indexCreateSql(String fullTblName, GridH2IndexBase h2Idx, boolean ifNotExists)
CREATE INDEX SQL statement for given params.fullTblName - Fully qualified table name.h2Idx - H2 index.ifNotExists - Quietly skip index creation if it exists.public static String indexDropSql(String schemaName, String idxName, boolean ifExists)
CREATE INDEX SQL statement for given params.schemaName - Quoted schema name.idxName - Index name.ifExists - Quietly skip index drop if it exists.public static List<IndexColumn> treeIndexColumns(GridH2RowDescriptor desc, List<IndexColumn> cols, IndexColumn keyCol, IndexColumn affCol)
desc - Row descriptor.cols - Columns list.keyCol - Primary key column.affCol - Affinity key column.public static GridH2IndexBase createSpatialIndex(GridH2Table tbl, String idxName, IndexColumn[] cols)
tbl - Table.idxName - Index name.cols - Columns.public static String withQuotes(String str)
str - String.public static List<GridQueryFieldMetadata> meta(ResultSetMetaData rsMeta) throws SQLException
rsMeta - Metadata.SQLException - If failed.public static Session session(Connection c)
c - Connection.public static void setupConnection(Connection conn, boolean distributedJoins, boolean enforceJoinOrder)
conn - Connection to use.distributedJoins - If distributed joins are enabled.enforceJoinOrder - Enforce join order of tables.public static Object convert(Object val, GridH2RowDescriptor desc, int type) throws IgniteCheckedException
val - Source value.desc - Row descriptor.type - Expected column type to convert to.IgniteCheckedException - if failed.public static <any> zeroCursor()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2-p3 Release Date : April 25 2019