java.lang.Object
com.github.tadukoo.database.mysql.transaction.update.Updates
All Implemented Interfaces:
SQLTransaction<Boolean>

public abstract class Updates extends Object implements 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 Details

    • Updates

      public Updates()
  • Method Details

    • getNames

      public List<String> getNames()
      Returns:
      The names of the MySQL statements to be executed
    • getSQLs

      public abstract List<String> 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 given EasyLogger
      Specified by:
      execute in interface SQLTransaction<Boolean>
      Parameters:
      conn - The Connection to use for the transaction
      logger - The EasyLogger to use for logging messages as needed
      Returns:
      The result of the transaction
      Throws:
      SQLException - If anything goes wrong
    • createUpdates

      public static Updates createUpdates(String transactionName, List<String> names, List<String> sqls)
      Creates a new Updates transaction with the given parameters
      Parameters:
      transactionName - The name for the overall transaction
      names - The names for individual statements, this may be null or an empty list
      sqls - The MySQL statements to be executed in the updates
      Returns:
      An Updates object that can run the transaction