java.lang.Object
org.litebridgedb.orm.persistence.TransactionalDatabaseProvider
- All Implemented Interfaces:
DatabaseProvider
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionalDatabaseProvider(TransactionManager transactionManager, DatabaseProvider databaseProvider) -
Method Summary
Modifier and TypeMethodDescriptiondelete(Delete delete, ConnectionProvider connectionProvider) Retrieve theTypeConverterinstance associated with the database provider.insert(Insert insert, ConnectionProvider connectionProvider) Execute an INSERT operation in the database using the providedInsertstatement.select(Select select, ConnectionProvider connectionProvider) Execute a SELECT operation in the database using the providedSelectstatement.tableMetaData(Table table, ConnectionProvider connectionProvider) Retrieve metadata for the specified table.update(Update update, ConnectionProvider connectionProvider) Execute an UPDATE operation in the database using the providedUpdatestatement.
-
Constructor Details
-
TransactionalDatabaseProvider
public TransactionalDatabaseProvider(TransactionManager transactionManager, DatabaseProvider databaseProvider)
-
-
Method Details
-
transactionManager
-
tableMetaData
public TableMetaData tableMetaData(Table table, ConnectionProvider connectionProvider) throws SQLException Description copied from interface:DatabaseProviderRetrieve metadata for the specified table.- Specified by:
tableMetaDatain interfaceDatabaseProvider- Parameters:
table- theTableobject representing the table for which metadata is to be retrieved.connectionProvider- theConnectionProviderused to get a database connection.- Returns:
- a
TableMetaDataobject containing metadata information about the specified table, including its columns, primary key, and other details. - Throws:
SQLException- if any SQL error occurs while retrieving the metadata.
-
insert
public InsertResult insert(Insert insert, ConnectionProvider connectionProvider) throws SQLException Description copied from interface:DatabaseProviderExecute an INSERT operation in the database using the providedInsertstatement.- Specified by:
insertin interfaceDatabaseProvider- Parameters:
insert- theInsertstatement containing the table, columns, and rows to insert.connectionProvider- theConnectionProviderused to get a database connection.- Returns:
- an
InsertResultcontaining the number of rows affected and any generated keys. - Throws:
SQLException- if any SQL error occurs during the execution of the insert operation.
-
update
public UpdateResult update(Update update, ConnectionProvider connectionProvider) throws SQLException Description copied from interface:DatabaseProviderExecute an UPDATE operation in the database using the providedUpdatestatement.- Specified by:
updatein interfaceDatabaseProvider- Parameters:
update- theUpdatestatement containing the table, columns, and rows to update.connectionProvider- theConnectionProviderused to get a database connection.- Returns:
- an
UpdateResultcontaining the number of rows affected. - Throws:
SQLException- if any SQL error occurs during the execution of the update operation.
-
delete
public UpdateResult delete(Delete delete, ConnectionProvider connectionProvider) throws SQLException - Specified by:
deletein interfaceDatabaseProvider- Throws:
SQLException
-
select
Description copied from interface:DatabaseProviderExecute a SELECT operation in the database using the providedSelectstatement.- Specified by:
selectin interfaceDatabaseProvider- Parameters:
select- theSelectstatement containing information about the table, columns, joins, conditions, ordering, and optional limits for the query.connectionProvider- theConnectionProviderused to get a database connection.- Returns:
- a
ListofRowobjects representing the results of the SELECT operation. - Throws:
SQLException- if any SQL error occurs during the execution of the SELECT operation.
-
toSql
- Specified by:
toSqlin interfaceDatabaseProvider
-
getTypeConverter
Description copied from interface:DatabaseProviderRetrieve theTypeConverterinstance associated with the database provider.The
TypeConverteris used for converting objects between different types, typically for database data type conversions and mapping domain-specific representations.- Specified by:
getTypeConverterin interfaceDatabaseProvider- Returns:
- the
TypeConverterinstance for handling data type conversions
-