public class H2Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsColumn(List<org.h2.table.IndexColumn> cols,
org.h2.table.IndexColumn col) |
static boolean |
containsKeyColumn(GridH2RowDescriptor desc,
List<org.h2.table.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,
org.h2.table.IndexColumn[] cols)
Create spatial index.
|
static boolean |
equals(org.h2.table.IndexColumn c1,
org.h2.table.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 org.h2.engine.Session |
session(Connection c) |
static void |
setupConnection(Connection conn,
boolean distributedJoins,
boolean enforceJoinOrder) |
static List<org.h2.table.IndexColumn> |
treeIndexColumns(GridH2RowDescriptor desc,
List<org.h2.table.IndexColumn> cols,
org.h2.table.IndexColumn keyCol,
org.h2.table.IndexColumn affCol) |
static String |
withQuotes(String str)
Add quotes around the name.
|
static QueryCursorImpl<List<?>> |
zeroCursor() |
public static boolean equals(org.h2.table.IndexColumn c1,
org.h2.table.IndexColumn c2)
c1 - First column.c2 - Second column.true If they are the same.public static boolean containsColumn(List<org.h2.table.IndexColumn> cols, org.h2.table.IndexColumn col)
cols - Columns list.col - Column to find.true If found.public static boolean containsKeyColumn(GridH2RowDescriptor desc, List<org.h2.table.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<org.h2.table.IndexColumn> treeIndexColumns(GridH2RowDescriptor desc, List<org.h2.table.IndexColumn> cols, org.h2.table.IndexColumn keyCol, org.h2.table.IndexColumn affCol)
desc - Row descriptor.cols - Columns list.keyCol - Primary key column.affCol - Affinity key column.public static GridH2IndexBase createSpatialIndex(GridH2Table tbl, String idxName, org.h2.table.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 org.h2.engine.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 QueryCursorImpl<List<?>> zeroCursor()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018