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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Updates
Creates 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 givenEasyLogger
getNames()
getSQLs()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
execute
in interfaceSQLTransaction<Boolean>
- Parameters:
conn
- TheConnection
to use for the transactionlogger
- TheEasyLogger
to 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
-