public final class H2Adaptor extends OpenSourceDbAdaptor
Constructor and Description |
---|
H2Adaptor(ConnectionPool connectionPool,
DdlConsumer ddlConsumer,
boolean isH2ReferentialIntegrity) |
Modifier and Type | Method and Description |
---|---|
DbColumnInfo |
getColumnInfo(Connection conn,
Column<?> c)
Returns information on a column.
|
int |
getCurrentIdent(Connection conn,
BasicTable t)
Returns current identity value for the table.
|
int |
getDBPid(Connection conn)
Returns process id of current database connection.
|
List<DbFkInfo> |
getFKInfo(Connection conn,
Grain g)
Returns information on the foreign keys from grain.
|
Map<String,DbIndexInfo> |
getIndices(Connection conn,
Grain g)
Returns a set of indices referring to tables specified in the indicated grain.
|
String |
getInFilterClause(DataGrainElement dge,
DataGrainElement otherDge,
List<String> fields,
List<String> otherFields,
String otherWhere) |
PreparedStatement |
getInsertRecordStatement(Connection conn,
BasicTable t,
boolean[] nullsMask,
List<ParameterSetter> program)
Creates a PreparedStatement object for an INSERT statement to insert a record into a table.
|
List<String> |
getParameterizedViewList(Connection conn,
Grain g)
Get names of existing parameterized views.
|
DbPkInfo |
getPKInfo(Connection conn,
TableElement t)
Returns information on the primary key of a table.
|
DbSequenceInfo |
getSequenceInfo(Connection conn,
SequenceElement s)
Returns information on a sequence.
|
DBType |
getType()
Returns current database type.
|
String |
translateDate(String date)
Translates Celesta date literal to the one from specific database.
|
boolean |
triggerExists(Connection conn,
TriggerQuery query)
Checks if trigger exists in the DB.
|
deleteRecordSetStatement, getColumns, getDeleteRecordStatement, getNavigationStatement, getOneFieldStatement, getOneRecordStatement, nextSequenceValue, nullsFirst, sequenceExists, tableExists
alterSequence, compareStrings, createColumn, createFK, createIndex, createParameterizedView, createPK, createSchemaIfNotExists, createSequence, createSysObjects, createTable, createTableTriggersForMaterializedViews, createView, dropFK, dropIndex, dropParameterizedView, dropPk, dropSequence, dropTable, dropTableTriggersForMaterializedViews, dropTrigger, dropView, executeNative, getCallFunctionSql, getRecordSetStatement, getSetCountStatement, getTriggerBody, getUpdateRecordStatement, getViewList, getViewSQLGenerator, initDataForMaterializedView, isValidConnection, pkConstraintString, prepareZonedDateTimeForParameterSetter, selectStaticStrings, sequenceString, supportsCortegeComparing, tableString, updateColumn, updateVersioningTrigger, userTablesExist
public H2Adaptor(ConnectionPool connectionPool, DdlConsumer ddlConsumer, boolean isH2ReferentialIntegrity)
public int getCurrentIdent(Connection conn, BasicTable t)
DBAdaptor
getCurrentIdent
in class DBAdaptor
conn
- DB connectiont
- tablepublic PreparedStatement getInsertRecordStatement(Connection conn, BasicTable t, boolean[] nullsMask, List<ParameterSetter> program)
DBAdaptor
getInsertRecordStatement
in class DBAdaptor
conn
- DB connectiont
- tablenullsMask
- null-flags (if set the corresponding field at n-th position becomes null
)program
- collects parameters that can be set with the querypublic List<String> getParameterizedViewList(Connection conn, Grain g)
DBAdaptor
getParameterizedViewList
in class DBAdaptor
conn
- connectiong
- current grainpublic DbColumnInfo getColumnInfo(Connection conn, Column<?> c)
DBAdaptor
getColumnInfo
in class DBAdaptor
conn
- DB connectionc
- columnpublic DbPkInfo getPKInfo(Connection conn, TableElement t)
DBAdaptor
public List<DbFkInfo> getFKInfo(Connection conn, Grain g)
DBAdaptor
public String getInFilterClause(DataGrainElement dge, DataGrainElement otherDge, List<String> fields, List<String> otherFields, String otherWhere)
public Map<String,DbIndexInfo> getIndices(Connection conn, Grain g)
DBAdaptor
getIndices
in class DBAdaptor
conn
- DB connectiong
- Grain the tables of which have to be traversed for the indices.public boolean triggerExists(Connection conn, TriggerQuery query) throws SQLException
DBAdaptor
triggerExists
in class DBAdaptor
conn
- DB connection.query
- trigger query parametersSQLException
- thrown if resulting query failspublic int getDBPid(Connection conn)
DBAdaptor
public String translateDate(String date)
DBAdaptor
translateDate
in interface QueryBuildingHelper
translateDate
in class DBAdaptor
date
- Date literalpublic DBType getType()
DBAdaptor
public DbSequenceInfo getSequenceInfo(Connection conn, SequenceElement s)
DBAdaptor
getSequenceInfo
in class DBAdaptor
conn
- DB connections
- sequenceCopyright © 2023 CURS. All rights reserved.