Class AbstractDatabaseUpgradeTask

java.lang.Object
com.foilen.smalltools.upgrader.tasks.AbstractUpgradeTask
com.foilen.smalltools.upgrader.tasks.AbstractDatabaseUpgradeTask
All Implemented Interfaces:
com.foilen.smalltools.upgrader.tasks.UpgradeTask

public abstract class AbstractDatabaseUpgradeTask extends com.foilen.smalltools.upgrader.tasks.AbstractUpgradeTask
Use this to have some common database helpers for your task.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.jdbc.core.JdbcTemplate
    The jdbc template to use.

    Fields inherited from class com.foilen.smalltools.upgrader.tasks.AbstractUpgradeTask

    logger

    Fields inherited from interface com.foilen.smalltools.upgrader.tasks.UpgradeTask

    DEFAULT_TRACKER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<String>
    Find all the tables in the database.
    protected void
    Purge the connections in the pool.
    protected void
    updateFromResource(String resourceName)
    Take a resource file and execute all the queries in it.
    protected void
    updateFromResource(String resourceName, Class<?> resourceCtx)
    Take a resource file and execute all the queries in it.
    Tells the tracker name to use.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.foilen.smalltools.upgrader.tasks.UpgradeTask

    execute
  • Field Details

    • jdbcTemplate

      @Autowired protected org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
      The jdbc template to use.
  • Constructor Details

    • AbstractDatabaseUpgradeTask

      public AbstractDatabaseUpgradeTask()
  • Method Details

    • mysqlTablesFindAll

      protected List<String> mysqlTablesFindAll()
      Find all the tables in the database.
      Returns:
      the list of tables
    • purgeConnections

      protected void purgeConnections()
      Purge the connections in the pool.
    • updateFromResource

      protected void updateFromResource(String resourceName)
      Take a resource file and execute all the queries in it.
      Parameters:
      resourceName - the name of the resource relative to this class
    • updateFromResource

      protected void updateFromResource(String resourceName, Class<?> resourceCtx)
      Take a resource file and execute all the queries in it.
      Parameters:
      resourceName - the name of the resource relative to the context class
      resourceCtx - the context class
    • useTracker

      public String useTracker()
      Tells the tracker name to use.
      Returns:
      the name