public class CockroachDBEngine extends PostgreSqlEngine
| Modifier and Type | Field and Description |
|---|---|
protected static String |
COCKROACHDB_DRIVER
The Cockroach JDBC (PostgreSQL) driver.
|
static String |
CONSTRAINT_NAME_ALREADY_EXISTS_COCKROACH
Constraint name already exists.
|
CONSTRAINT_NAME_ALREADY_EXISTS, NAME_ALREADY_EXISTS, PG_QUERY_EXCEPTION_HANDLER, POSTGRESQL_DRIVER, TABLE_CAN_ONLY_HAVE_ONE_PRIMARY_KEY, TABLE_OR_VIEW_DOES_NOT_EXISTconn, currentSchema, DEFAULT_QUERY_EXCEPTION_HANDLER, dev, dialect, eh, entities, injector, logger, notificationLogger, properties, socketTimeoutExecutor, stmts, translator| Constructor and Description |
|---|
CockroachDBEngine(PdbProperties properties)
Creates a new CockroachDB connection.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFks(DbEntity entity,
Set<DbFk> fks)
Adds foreign key constraints to the table in the database that the provided entity represents.
|
protected void |
addPrimaryKey(DbEntity entity)
Add a primary key to the entity.
|
protected void |
addSequences(DbEntity entity)
Adds the necessary sequences.
|
protected void |
createTable(DbEntity entity)
Creates the table.
|
protected void |
dropSequences(DbEntity entity)
Drops the sequences of the entity.
|
Map<String,DbColumnType> |
getMetadata(String schemaPattern,
String tableNamePattern)
Gets the table metadata (table must be in the current schema).
|
Class<? extends AbstractTranslator> |
getTranslatorClass()
Gets the class that translates SQL bound to this engine.
|
protected void |
updatePersistAutoIncSequence(MappedEntity mappedEntity,
long currentAutoIncVal)
Updates the autoInc sequence value after a persist operation.
|
addColumn, addIndexes, checkConnection, createPreparedStatementForInserts, createResultIterator, createResultIterator, doPersist, dropColumn, dropTable, entityToPreparedStatement, getDBProperties, getQueryExceptionHandler, isStringAggDistinctCapable, setParameter, setSchema, toPdbTypeaddBatch, addEntity, addFks, beginTransaction, checkConnection, checkConnection, clearParameters, close, commentCharacter, commit, connect, containsEntity, createBatch, createBatch, createBatch, createBatch, createBatch, createPreparedStatement, createPreparedStatement, createPreparedStatement, createPreparedStatement, createSelectStatement, dropEntity, dropEntity, dropFkQuery, dropFks, dropFks, dropView, duplicate, entityToPreparedStatementForBatch, escapeCharacter, executePS, executePSUpdate, executeUpdate, executeUpdate, executeUpdateSilently, flush, getConnection, getDialect, getEntities, getEntities, getFinalJdbcConnection, getImportedKeys, getMetadata, getPreparedStatementForPersist, getPrivateKey, getProperties, getPSIterator, getPSIterator, getPSResultSet, getQueryMetadata, getQueryMetadata, getSchema, handleOperation, hasIdentityColumn, inject, isTransactionActive, iterator, iterator, iterator, iterator, iterator, iterator, loadEntity, objectToArray, persist, persist, preparedStatementExists, processResultIterator, query, query, query, query, reconnectExceptionally, removeEntity, removePreparedStatement, rollback, setExceptionHandler, setParameter, setParameters, setParameterValues, setTransactionIsolation, translate, translateType, updateEntityprotected static final String COCKROACHDB_DRIVER
public static final String CONSTRAINT_NAME_ALREADY_EXISTS_COCKROACH
public CockroachDBEngine(PdbProperties properties) throws DatabaseEngineException
properties - The properties for the database connection.DatabaseEngineException - When the connection fails.protected void createTable(DbEntity entity) throws DatabaseEngineException
AbstractDatabaseEnginecreateTable in class PostgreSqlEngineentity - The entity.DatabaseEngineException - If something goes wrong while creating the table.protected void addPrimaryKey(DbEntity entity) throws DatabaseEngineException
AbstractDatabaseEngineaddPrimaryKey in class PostgreSqlEngineentity - The entity.DatabaseEngineException - If something goes wrong while creating the table.public Class<? extends AbstractTranslator> getTranslatorClass()
AbstractDatabaseEnginegetTranslatorClass in class PostgreSqlEngineprotected void updatePersistAutoIncSequence(MappedEntity mappedEntity, long currentAutoIncVal)
PostgreSqlEngineupdatePersistAutoIncSequence in class PostgreSqlEnginemappedEntity - The mapped entity to for which to update the autoInc sequence.currentAutoIncVal - The current value for the autoInc column.protected void addFks(DbEntity entity, Set<DbFk> fks) throws DatabaseEngineException
AbstractDatabaseEngineaddFks in class PostgreSqlEngineentity - The entity.fks - The foreign keys to be added.DatabaseEngineException - If something goes wrong creating the FKs.protected void addSequences(DbEntity entity) throws DatabaseEngineException
AbstractDatabaseEngineaddSequences in class PostgreSqlEngineentity - The entity.DatabaseEngineException - If something goes wrong while creating the table.protected void dropSequences(DbEntity entity) throws DatabaseEngineException
AbstractDatabaseEnginedropSequences in class PostgreSqlEngineentity - The entity.DatabaseEngineException - If something goes wrong dropping the sequences.public Map<String,DbColumnType> getMetadata(String schemaPattern, String tableNamePattern) throws DatabaseEngineException
DatabaseEnginegetMetadata in interface DatabaseEnginegetMetadata in class AbstractDatabaseEngineschemaPattern - A schema name pattern; must match the schema name as it is stored in the database;
"" retrieves those without a schema; null means that the schema name
should not be used to narrow the search.tableNamePattern - A table name pattern; must match the table name as it is stored in the database.DatabaseEngineException - If something occurs getting the metadata.Copyright © 2021 Feedzai. All rights reserved.