Class Updates
java.lang.Object
com.github.tadukoo.database.mysql.transaction.update.Updates
- All Implemented Interfaces:
SQLTransaction<Boolean>
Represents one or more MySQL update statements to be executed as a transaction.
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UpdatesCreates a new Updates transaction with the given parametersexecute(Connection conn, com.github.tadukoo.util.logger.EasyLogger logger) Executes the transaction using the given connection, and will log messages as needed to the givenEasyLoggergetNames()getSQLs()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.tadukoo.database.mysql.transaction.SQLTransaction
getTransactionName
-
Constructor Details
-
Updates
public Updates()
-
-
Method Details
-
getNames
- Returns:
- The names of the MySQL statements to be executed
-
getSQLs
- Returns:
- The List of MySQL statements to be executed as updates
-
execute
public Boolean execute(Connection conn, com.github.tadukoo.util.logger.EasyLogger logger) throws SQLException Executes the transaction using the given connection, and will log messages as needed to the givenEasyLogger- Specified by:
executein interfaceSQLTransaction<Boolean>- Parameters:
conn- TheConnectionto use for the transactionlogger- TheEasyLoggerto use for logging messages as needed- Returns:
- The result of the transaction
- Throws:
SQLException- If anything goes wrong
-
createUpdates
Creates a new Updates transaction with the given parameters- Parameters:
transactionName- The name for the overall transactionnames- The names for individual statements, this may be null or an empty listsqls- The MySQL statements to be executed in the updates- Returns:
- An Updates object that can run the transaction
-