public class CockroachDBEngine extends PostgreSqlEngine
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
COCKROACHDB_DRIVER
The Cockroach JDBC (PostgreSQL) driver.
|
static java.lang.String |
CONSTRAINT_NAME_ALREADY_EXISTS_COCKROACH
Constraint name already exists.
|
CONSTRAINT_NAME_ALREADY_EXISTS, NAME_ALREADY_EXISTS, POSTGRESQL_DRIVER, SQL_STATE_DEADLOCK_TRANSACTION_FAILURE, TABLE_CAN_ONLY_HAVE_ONE_PRIMARY_KEY, TABLE_OR_VIEW_DOES_NOT_EXISTconn, currentSchema, dev, dialect, eh, entities, injector, logger, notificationLogger, properties, stmts, translator| Constructor and Description |
|---|
CockroachDBEngine(PdbProperties properties)
Creates a new CockroachDB connection.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFks(DbEntity entity)
Adds the FKs.
|
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.
|
java.util.Map<java.lang.String,DbColumnType> |
getMetadata(java.lang.String schemaPattern,
java.lang.String tableNamePattern)
Gets the table metadata (table must be in the current schema).
|
java.lang.Class<? extends AbstractTranslator> |
getTranslatorClass()
Gets the class that translates SQL bound to this engine.
|
java.lang.Long |
persist(java.lang.String name,
EntityEntry entry,
boolean useAutoInc)
Persists a given entry.
|
addColumn, addIndexes, checkConnection, createPreparedStatementForInserts, createResultIterator, createResultIterator, dropColumn, dropTable, entityToPreparedStatement, getDBProperties, isRetryableException, isStringAggDistinctCapable, persist, setParameter, setSchema, toPdbType, translateTypeaddBatch, addEntity, beginTransaction, checkConnection, checkConnection, clearParameters, close, commentCharacter, commit, connect, containsEntity, createBatch, createBatch, createBatch, createPreparedStatement, createPreparedStatement, createPreparedStatement, createPreparedStatement, createSelectStatement, dropEntity, dropEntity, dropFks, duplicate, entityToPreparedStatementForBatch, escapeCharacter, executePS, executePSUpdate, executeUpdate, executeUpdate, executeUpdateSilently, flush, getConnection, getDialect, getEntities, getEntities, getFinalJdbcConnection, getMetadata, getPrivateKey, getProperties, getPSIterator, getPSIterator, getPSResultSet, getQueryMetadata, getQueryMetadata, getSchema, handleOperation, hasIdentityColumn, inject, isTransactionActive, iterator, iterator, iterator, iterator, iterator, iterator, loadEntity, objectToArray, preparedStatementExists, processResultIterator, query, query, query, query, removeEntity, removePreparedStatement, rollback, setExceptionHandler, setParameter, setParameters, setParameterValues, setTransactionIsolation, translate, updateEntityprotected static final java.lang.String COCKROACHDB_DRIVER
public static final java.lang.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 java.lang.Class<? extends AbstractTranslator> getTranslatorClass()
AbstractDatabaseEnginegetTranslatorClass in class PostgreSqlEnginepublic java.lang.Long persist(java.lang.String name,
EntityEntry entry,
boolean useAutoInc)
throws DatabaseEngineException
AbstractDatabaseEnginePersists a given entry. Persisting a query implies executing the statement. If define useAutoInc as false, PDB will disable the auto increments for the current insert and advance the sequences if needed.
If you are inside of an explicit transaction, changes will only be visible upon explicit commit, otherwise a commit will immediately take place.
persist in interface DatabaseEnginepersist in class PostgreSqlEnginename - The entity name.entry - The entry to persist.useAutoInc - Use or not the autoinc.DatabaseEngineException - If something goes wrong while persisting data.protected void addFks(DbEntity entity) throws DatabaseEngineException
AbstractDatabaseEngineaddFks in class PostgreSqlEngineentity - The entity.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 java.util.Map<java.lang.String,DbColumnType> getMetadata(java.lang.String schemaPattern, java.lang.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 © 2019 Feedzai. All Rights Reserved.