public final class FirebirdAdaptor extends DBAdaptor
Constructor and Description |
---|
FirebirdAdaptor(ConnectionPool connectionPool,
DdlConsumer ddlConsumer) |
Modifier and Type | Method and Description |
---|---|
void |
createSysObjects(Connection conn,
String sysSchemaName)
Creates or recreates other system objects (stored procedures, functions)
needed for Celesta functioning on current RDBMS.
|
PreparedStatement |
deleteRecordSetStatement(Connection conn,
TableElement t,
String where)
Creates a PreparedStatement object for a DELETE statement for deleting a set of records that
satisfy a condition.
|
void |
dropSequence(Connection conn,
SequenceElement s)
Drops sequence from the database.
|
DbColumnInfo |
getColumnInfo(Connection conn,
Column<?> c)
Returns information on a column.
|
Set<String> |
getColumns(Connection conn,
TableElement t)
Returns a set of column names for a specific table.
|
int |
getCurrentIdent(Connection conn,
BasicTable t)
Returns current identity value for the table.
|
int |
getDBPid(Connection conn)
Returns process id of current database connection.
|
PreparedStatement |
getDeleteRecordStatement(Connection conn,
TableElement t,
String where)
Creates a PreparedStatement object for a DELETE statement for deleting a set of records that
satisfy a condition.
|
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 whereForOtherTable) |
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.
|
PreparedStatement |
getNavigationStatement(Connection conn,
FromClause from,
String orderBy,
String navigationWhereClause,
Set<String> fields,
long offset)
Returns navigable PreparedStatement by a filtered set of records.
|
PreparedStatement |
getOneFieldStatement(Connection conn,
Column<?> c,
String where)
Creates a PreparedStatement object for a SELECT statement of a single column containing
at most one record.
|
PreparedStatement |
getOneRecordStatement(Connection conn,
TableElement t,
String where,
Set<String> fields)
Creates a PreparedStatement object for a SELECT statement containing at most one record.
|
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.
|
List<String> |
getViewList(Connection conn,
Grain g)
Returns list of view names in the grain.
|
long |
nextSequenceValue(Connection conn,
SequenceElement s)
Retrieves next value from the sequence.
|
boolean |
nullsFirst()
Does RDBMS sort nulls first?
|
String |
pkConstraintString(TableElement tableElement)
Returns DB specific PK constraint name for a table element.
|
ZonedDateTime |
prepareZonedDateTimeForParameterSetter(Connection conn,
ZonedDateTime z) |
static String |
sequenceCurValueProcString(String schemaName,
String sequenceName) |
boolean |
sequenceExists(Connection conn,
String schema,
String name)
Checks if sequence exists in the DB.
|
static String |
sequenceNextValueProcString(String schemaName,
String sequenceName) |
String |
sequenceString(String schemaName,
String sequenceName)
Returns template by sequence name.
|
boolean |
tableExists(Connection conn,
String schema,
String name)
Checks if table exists in the DB.
|
String |
tableString(String schemaName,
String tableName)
Returns template by table name.
|
boolean |
triggerExists(Connection conn,
TriggerQuery query)
Checks if trigger exists in the DB.
|
alterSequence, compareStrings, createColumn, createFK, createIndex, createParameterizedView, createPK, createSchemaIfNotExists, createSequence, createTable, createTableTriggersForMaterializedViews, createView, dropFK, dropIndex, dropParameterizedView, dropPk, dropTable, dropTableTriggersForMaterializedViews, dropTrigger, dropView, executeNative, getCallFunctionSql, getRecordSetStatement, getSetCountStatement, getTriggerBody, getUpdateRecordStatement, getViewSQLGenerator, initDataForMaterializedView, isValidConnection, selectStaticStrings, supportsCortegeComparing, translateDate, updateColumn, updateVersioningTrigger, userTablesExist
public FirebirdAdaptor(ConnectionPool connectionPool, DdlConsumer ddlConsumer)
public PreparedStatement getNavigationStatement(Connection conn, FromClause from, String orderBy, String navigationWhereClause, Set<String> fields, long offset)
DBAdaptor
getNavigationStatement
in class DBAdaptor
conn
- Connectionfrom
- From clauseorderBy
- Sorting order (ascending or descending)navigationWhereClause
- Navigable set condition (from current record)fields
- Fields of selectionoffset
- First record offsetpublic boolean tableExists(Connection conn, String schema, String name)
DBAdaptor
tableExists
in class DBAdaptor
conn
- DB connectionschema
- schema namename
- table namepublic 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 Set<String> getColumns(Connection conn, TableElement t)
DBAdaptor
getColumns
in class DBAdaptor
conn
- DB connectiont
- Table to look the columns in.public PreparedStatement getOneRecordStatement(Connection conn, TableElement t, String where, Set<String> fields)
DBAdaptor
getOneRecordStatement
in class DBAdaptor
conn
- DB connectiont
- tablewhere
- WHERE conditionfields
- fields of selectionpublic PreparedStatement getOneFieldStatement(Connection conn, Column<?> c, String where)
DBAdaptor
getOneFieldStatement
in class DBAdaptor
conn
- DB connectionc
- column to selectwhere
- WHERE conditionpublic PreparedStatement deleteRecordSetStatement(Connection conn, TableElement t, String where)
DBAdaptor
deleteRecordSetStatement
in class DBAdaptor
conn
- DB connectiont
- tablewhere
- conditionpublic 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 int getCurrentIdent(Connection conn, BasicTable t)
DBAdaptor
getCurrentIdent
in class DBAdaptor
conn
- DB connectiont
- tablepublic PreparedStatement getDeleteRecordStatement(Connection conn, TableElement t, String where)
DBAdaptor
getDeleteRecordStatement
in class DBAdaptor
conn
- DB connectiont
- tablewhere
- condition (can be null
)public 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 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 List<String> getParameterizedViewList(Connection conn, Grain g)
DBAdaptor
getParameterizedViewList
in class DBAdaptor
conn
- connectiong
- current grainpublic int getDBPid(Connection conn)
DBAdaptor
public DBType getType()
DBAdaptor
public long nextSequenceValue(Connection conn, SequenceElement s)
DBAdaptor
nextSequenceValue
in class DBAdaptor
conn
- DB connections
- sequencepublic ZonedDateTime prepareZonedDateTimeForParameterSetter(Connection conn, ZonedDateTime z)
prepareZonedDateTimeForParameterSetter
in interface QueryBuildingHelper
prepareZonedDateTimeForParameterSetter
in class DBAdaptor
public void dropSequence(Connection conn, SequenceElement s)
DBAdaptor
dropSequence
in class DBAdaptor
conn
- DB connections
- sequence elementpublic static String sequenceCurValueProcString(String schemaName, String sequenceName)
public static String sequenceNextValueProcString(String schemaName, String sequenceName)
public boolean sequenceExists(Connection conn, String schema, String name)
DBAdaptor
sequenceExists
in class DBAdaptor
conn
- DB connectionschema
- schema namename
- sequence namepublic DbSequenceInfo getSequenceInfo(Connection conn, SequenceElement s)
DBAdaptor
getSequenceInfo
in class DBAdaptor
conn
- DB connections
- sequencepublic boolean nullsFirst()
QueryBuildingHelper
public String getInFilterClause(DataGrainElement dge, DataGrainElement otherDge, List<String> fields, List<String> otherFields, String whereForOtherTable)
public void createSysObjects(Connection conn, String sysSchemaName)
DBAdaptor
createSysObjects
in class DBAdaptor
conn
- DB connectionsysSchemaName
- system schema namepublic List<String> getViewList(Connection conn, Grain g)
DBAdaptor
getViewList
in class DBAdaptor
conn
- DB connectiong
- Grain for which the list of view names have to be returned.public String tableString(String schemaName, String tableName)
DBAdaptor
tableString
in class DBAdaptor
schemaName
- schema nametableName
- table namepublic String pkConstraintString(TableElement tableElement)
DBAdaptor
pkConstraintString
in class DBAdaptor
tableElement
- table elementCopyright © 2023 CURS. All rights reserved.