A
- the generic typepublic class DatabaseGateway<A extends DbmsAdaptor<A>> extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
connectionEnabled
The connection enabled.
|
protected ConnectionProvider<A> |
connectionProvider
The connection provider.
|
protected A |
dbmsAdaptor
The dbms adaptor.
|
boolean |
indexValidation_createMissingIndices
The index validation_create missing indices.
|
boolean |
indexValidation_dropUndefinedIndices
The index validation_drop undefined indices.
|
boolean |
indexValidationEnabled
The index validation enabled.
|
boolean |
validateTableColumns
The validate table columns.
|
Constructor and Description |
---|
DatabaseGateway(ConnectionProvider<A> connectionProvider)
Instantiates a new database gateway.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close.
|
DatabaseGateway<A> |
connect()
Connect.
|
void |
dropIndex(SqlIndex index)
Drop index.
|
static <A extends DbmsAdaptor<A>,R> |
execute(DatabaseGateway<A> databaseGateway,
Query query,
LoggingContext loggingContext,
SqlExecutor<R> executor,
Object... parameters) |
<R> R |
execute(SqlExecutor<R> executor,
String sql) |
Connection |
getConnection()
Gets the connection.
|
A |
getDbmsAdaptor()
Gets the dbms adaptor.
|
boolean |
isConnectionEnabled()
Checks if is connection enabled.
|
void |
setConnectionEnabled(boolean connectionEnabled)
Sets the connection enabled.
|
String |
toString() |
protected ConnectionProvider<A extends DbmsAdaptor<A>> connectionProvider
protected A extends DbmsAdaptor<A> dbmsAdaptor
public final boolean validateTableColumns
public final boolean indexValidationEnabled
public final boolean indexValidation_createMissingIndices
public final boolean indexValidation_dropUndefinedIndices
protected boolean connectionEnabled
public DatabaseGateway(ConnectionProvider<A> connectionProvider)
connectionProvider
- the connection providerpublic void close() throws SQLEngineException
SQLEngineException
- the sQL engine exceptionpublic A getDbmsAdaptor()
public DatabaseGateway<A> connect() throws SQLEngineCouldNotConnectToDBException
SQLEngineCouldNotConnectToDBException
- the sQL engine could not connect to db exceptionpublic Connection getConnection()
public static final <A extends DbmsAdaptor<A>,R> R execute(DatabaseGateway<A> databaseGateway, Query query, LoggingContext loggingContext, SqlExecutor<R> executor, Object... parameters)
public <R> R execute(SqlExecutor<R> executor, String sql) throws SQLEngineException
SQLEngineException
public void dropIndex(SqlIndex index) throws SQLEngineException
index
- the indexSQLEngineException
- the sQL engine exceptionpublic boolean isConnectionEnabled()
public void setConnectionEnabled(boolean connectionEnabled)
connectionEnabled
- the connectionEnabled to setpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2021 XDEV Software. All rights reserved.