Package ru.curs.celesta.dbutils.adaptors
Class PostgresAdaptor
java.lang.Object
ru.curs.celesta.dbutils.adaptors.DBAdaptor
ru.curs.celesta.dbutils.adaptors.OpenSourceDbAdaptor
ru.curs.celesta.dbutils.adaptors.PostgresAdaptor
- All Implemented Interfaces:
StaticDataAdaptor,QueryBuildingHelper
Postgres adaptor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateSysObjects(Connection conn, String sysSchemaName) Creates or recreates other system objects (stored procedures, functions) needed for Celesta functioning on current RDBMS.getColumnInfo(Connection conn, Column<?> c) Returns information on a column.intgetCurrentIdent(Connection conn, BasicTable t) Returns current identity value for the table.intgetDBPid(Connection conn) Returns process id of current database connection.getFKInfo(Connection conn, Grain g) Returns information on the foreign keys from grain.getIndices(Connection conn, Grain g) Returns a set of indices referring to tables specified in the indicated grain.getInFilterClause(DataGrainElement dge, DataGrainElement otherDge, List<String> fields, List<String> otherFields, String otherWhere) 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.getParameterizedViewList(Connection conn, Grain g) Get names of existing parameterized views.getPKInfo(Connection conn, TableElement t) Returns information on the primary key of a table.getSequenceInfo(Connection conn, SequenceElement s) Returns information on a sequence.getType()Returns current database type.booleanWhether DB supports cortege comparing.booleantriggerExists(Connection conn, TriggerQuery query) Checks if trigger exists in the DB.Methods inherited from class ru.curs.celesta.dbutils.adaptors.OpenSourceDbAdaptor
deleteRecordSetStatement, getColumns, getDeleteRecordStatement, getNavigationStatement, getOneFieldStatement, getOneRecordStatement, nextSequenceValue, nullsFirst, sequenceExists, tableExistsMethods inherited from class ru.curs.celesta.dbutils.adaptors.DBAdaptor
alterSequence, compareStrings, createColumn, createFK, createIndex, createParameterizedView, createPK, createSchemaIfNotExists, createSequence, createTable, createTableTriggersForMaterializedViews, createView, dropFK, dropIndex, dropParameterizedView, dropPk, dropSequence, dropTable, dropTableTriggersForMaterializedViews, dropTrigger, dropView, executeNative, getCallFunctionSql, getRecordSetStatement, getSetCountStatement, getTriggerBody, getUpdateRecordStatement, getViewList, getViewSQLGenerator, initDataForMaterializedView, isValidConnection, pkConstraintString, selectStaticStrings, sequenceString, tableString, translateDate, updateColumn, updateVersioningTrigger, userTablesExist
-
Constructor Details
-
PostgresAdaptor
-
-
Method Details
-
getCurrentIdent
Description copied from class:DBAdaptorReturns current identity value for the table.- Specified by:
getCurrentIdentin classDBAdaptor- Parameters:
conn- DB connectiont- table
-
getInsertRecordStatement
public PreparedStatement getInsertRecordStatement(Connection conn, BasicTable t, boolean[] nullsMask, List<ParameterSetter> program) Description copied from class:DBAdaptorCreates a PreparedStatement object for an INSERT statement to insert a record into a table.- Specified by:
getInsertRecordStatementin classDBAdaptor- Parameters:
conn- DB connectiont- tablenullsMask- null-flags (if set the corresponding field at n-th position becomesnull)program- collects parameters that can be set with the query
-
getColumnInfo
Description copied from class:DBAdaptorReturns information on a column.- Specified by:
getColumnInfoin classDBAdaptor- Parameters:
conn- DB connectionc- column
-
getInFilterClause
public String getInFilterClause(DataGrainElement dge, DataGrainElement otherDge, List<String> fields, List<String> otherFields, String otherWhere) -
getParameterizedViewList
Description copied from class:DBAdaptorGet names of existing parameterized views.- Specified by:
getParameterizedViewListin classDBAdaptor- Parameters:
conn- connectiong- current grain
-
getPKInfo
Description copied from class:DBAdaptorReturns information on the primary key of a table. -
getFKInfo
Description copied from class:DBAdaptorReturns information on the foreign keys from grain. -
getIndices
Description copied from class:DBAdaptorReturns a set of indices referring to tables specified in the indicated grain.- Specified by:
getIndicesin classDBAdaptor- Parameters:
conn- DB connectiong- Grain the tables of which have to be traversed for the indices.
-
createSysObjects
Description copied from class:DBAdaptorCreates or recreates other system objects (stored procedures, functions) needed for Celesta functioning on current RDBMS.- Overrides:
createSysObjectsin classDBAdaptor- Parameters:
conn- DB connectionsysSchemaName- system schema name
-
triggerExists
Description copied from class:DBAdaptorChecks if trigger exists in the DB.- Specified by:
triggerExistsin classDBAdaptor- Parameters:
conn- DB connection.query- trigger query parameters- Throws:
SQLException- thrown if resulting query fails
-
getDBPid
Description copied from class:DBAdaptorReturns process id of current database connection. -
prepareZonedDateTimeForParameterSetter
- Specified by:
prepareZonedDateTimeForParameterSetterin interfaceQueryBuildingHelper- Overrides:
prepareZonedDateTimeForParameterSetterin classDBAdaptor
-
getType
Description copied from class:DBAdaptorReturns current database type. E.g. H2, POSTGRESQL etc. -
supportsCortegeComparing
public boolean supportsCortegeComparing()Description copied from class:DBAdaptorWhether DB supports cortege comparing.- Specified by:
supportsCortegeComparingin interfaceQueryBuildingHelper- Overrides:
supportsCortegeComparingin classDBAdaptor- Returns:
-
getSequenceInfo
Description copied from class:DBAdaptorReturns information on a sequence.- Specified by:
getSequenceInfoin classDBAdaptor- Parameters:
conn- DB connections- sequence
-