Package ru.curs.celesta.dbutils.adaptors
Class OraAdaptor
java.lang.Object
ru.curs.celesta.dbutils.adaptors.DBAdaptor
ru.curs.celesta.dbutils.adaptors.OraAdaptor
- All Implemented Interfaces:
StaticDataAdaptor,QueryBuildingHelper
Oracle Database Adaptor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteRecordSetStatement(Connection conn, TableElement t, String where) Creates a PreparedStatement object for a DELETE statement for deleting a set of records that satisfy a condition.Prepares a function call expression.getColumnInfo(Connection conn, Column<?> c) Returns information on a column.getColumns(Connection conn, TableElement t) Returns a set of column names for a specific table.intgetCurrentIdent(Connection conn, BasicTable t) Returns current identity value for the table.intgetDBPid(Connection conn) Returns process id of current database connection.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.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.getNavigationStatement(Connection conn, FromClause from, String orderBy, String navigationWhereClause, Set<String> fields, long offset) Returns navigable PreparedStatement by a filtered set of records.getOneFieldStatement(Connection conn, Column<?> c, String where) Creates a PreparedStatement object for a SELECT statement of a single column containing at most one record.getOneRecordStatement(Connection conn, TableElement t, String where, Set<String> fields) Creates a PreparedStatement object for a SELECT statement containing at most one record.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.getViewList(Connection conn, Grain g) Returns list of view names in the grain.booleanisValidConnection(Connection conn, int timeout) Checking for connection validity.longnextSequenceValue(Connection conn, SequenceElement s) Retrieves next value from the sequence.booleanTells whether RDBMS sorts nulls first.pkConstraintString(TableElement tableElement) Returns DB specific PK constraint name for a table element.booleansequenceExists(Connection conn, String schema, String name) Checks if sequence exists in the DB.sequenceString(String schemaName, String sequenceName) Returns template by sequence name.booleantableExists(Connection conn, String schema, String name) Checks if table exists in the DB.tableString(String schemaName, String tableName) Returns template by table name.translateDate(String date) Translates Celesta date literal to the one from specific database.booleantriggerExists(Connection conn, TriggerQuery query) Checks if trigger exists in the DB.Methods inherited from class ru.curs.celesta.dbutils.adaptors.DBAdaptor
alterSequence, compareStrings, createColumn, createFK, createIndex, createParameterizedView, createPK, createSchemaIfNotExists, createSequence, createSysObjects, createTable, createTableTriggersForMaterializedViews, createView, dropFK, dropIndex, dropParameterizedView, dropPk, dropSequence, dropTable, dropTableTriggersForMaterializedViews, dropTrigger, dropView, executeNative, getRecordSetStatement, getRenameRecordStatement, getSetCountStatement, getTriggerBody, getUpdateRecordStatement, getViewSQLGenerator, initDataForMaterializedView, selectStaticStrings, supportsCortegeComparing, updateColumn, updateVersioningTrigger, userTablesExist
-
Constructor Details
-
OraAdaptor
-
-
Method Details
-
tableExists
Description copied from class:DBAdaptorChecks if table exists in the DB.- Specified by:
tableExistsin classDBAdaptor- Parameters:
conn- DB connectionschema- schema namename- table name
-
getOneFieldStatement
Description copied from class:DBAdaptorCreates a PreparedStatement object for a SELECT statement of a single column containing at most one record.- Specified by:
getOneFieldStatementin classDBAdaptor- Parameters:
conn- DB connectionc- column to selectwhere- WHERE condition
-
getOneRecordStatement
public PreparedStatement getOneRecordStatement(Connection conn, TableElement t, String where, Set<String> fields) Description copied from class:DBAdaptorCreates a PreparedStatement object for a SELECT statement containing at most one record.- Specified by:
getOneRecordStatementin classDBAdaptor- Parameters:
conn- DB connectiont- tablewhere- WHERE conditionfields- fields of selection
-
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
-
getDeleteRecordStatement
Description copied from class:DBAdaptorCreates a PreparedStatement object for a DELETE statement for deleting a set of records that satisfy a condition.- Specified by:
getDeleteRecordStatementin classDBAdaptor- Parameters:
conn- DB connectiont- tablewhere- condition (can benull)
-
getColumns
Description copied from class:DBAdaptorReturns a set of column names for a specific table.- Overrides:
getColumnsin classDBAdaptor- Parameters:
conn- DB connectiont- Table to look the columns in.
-
deleteRecordSetStatement
Description copied from class:DBAdaptorCreates a PreparedStatement object for a DELETE statement for deleting a set of records that satisfy a condition.- Specified by:
deleteRecordSetStatementin classDBAdaptor- Parameters:
conn- DB connectiont- tablewhere- condition
-
isValidConnection
Description copied from class:DBAdaptorChecking for connection validity.- Overrides:
isValidConnectionin classDBAdaptor- Parameters:
conn- connectiontimeout- time-out- Returns:
trueif connection is valid, otherwisefalse
-
tableString
Description copied from class:DBAdaptorReturns template by table name.- Overrides:
tableStringin classDBAdaptor- Parameters:
schemaName- schema nametableName- table name
-
sequenceString
Description copied from class:DBAdaptorReturns template by sequence name.- Overrides:
sequenceStringin classDBAdaptor- Parameters:
schemaName- schema namesequenceName- sequence name
-
pkConstraintString
Description copied from class:DBAdaptorReturns DB specific PK constraint name for a table element.- Overrides:
pkConstraintStringin classDBAdaptor- Parameters:
tableElement- table element
-
getCurrentIdent
Description copied from class:DBAdaptorReturns current identity value for the table.- Specified by:
getCurrentIdentin classDBAdaptor- Parameters:
conn- DB connectiont- table
-
getInFilterClause
public String getInFilterClause(DataGrainElement dge, DataGrainElement otherDge, List<String> fields, List<String> otherFields, String otherWhere) -
getColumnInfo
Description copied from class:DBAdaptorReturns information on a column.- Specified by:
getColumnInfoin classDBAdaptor- Parameters:
conn- DB connectionc- column
-
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.
-
getViewList
Description copied from class:DBAdaptorReturns list of view names in the grain.- Overrides:
getViewListin classDBAdaptor- Parameters:
conn- DB connectiong- Grain for which the list of view names have to be returned.
-
getParameterizedViewList
Description copied from class:DBAdaptorGet names of existing parameterized views.- Specified by:
getParameterizedViewListin classDBAdaptor- Parameters:
conn- connectiong- current grain
-
getCallFunctionSql
Description copied from class:DBAdaptorPrepares a function call expression.- Overrides:
getCallFunctionSqlin classDBAdaptor- Parameters:
pv- current parameterized view
-
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
-
translateDate
Description copied from class:DBAdaptorTranslates Celesta date literal to the one from specific database.- Specified by:
translateDatein interfaceQueryBuildingHelper- Overrides:
translateDatein classDBAdaptor- Parameters:
date- Date literal
-
getDBPid
Description copied from class:DBAdaptorReturns process id of current database connection. -
prepareZonedDateTimeForParameterSetter
- Specified by:
prepareZonedDateTimeForParameterSetterin interfaceQueryBuildingHelper- Overrides:
prepareZonedDateTimeForParameterSetterin classDBAdaptor
-
nullsFirst
public boolean nullsFirst()Description copied from interface:QueryBuildingHelperTells whether RDBMS sorts nulls first. -
getType
Description copied from class:DBAdaptorReturns current database type. E.g. H2, POSTGRESQL etc. -
nextSequenceValue
Description copied from class:DBAdaptorRetrieves next value from the sequence.- Specified by:
nextSequenceValuein classDBAdaptor- Parameters:
conn- DB connections- sequence
-
sequenceExists
Description copied from class:DBAdaptorChecks if sequence exists in the DB.- Specified by:
sequenceExistsin classDBAdaptor- Parameters:
conn- DB connectionschema- schema namename- sequence name
-
getSequenceInfo
Description copied from class:DBAdaptorReturns information on a sequence.- Specified by:
getSequenceInfoin classDBAdaptor- Parameters:
conn- DB connections- sequence
-