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
FieldsModifier and TypeFieldDescriptionprotected org.springframework.jdbc.core.JdbcTemplateThe jdbc template to use.Fields inherited from class com.foilen.smalltools.upgrader.tasks.AbstractUpgradeTask
loggerFields inherited from interface com.foilen.smalltools.upgrader.tasks.UpgradeTask
DEFAULT_TRACKER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFind all the tables in the database.protected voidPurge the connections in the pool.protected voidupdateFromResource(String resourceName) Take a resource file and execute all the queries in it.protected voidupdateFromResource(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, waitMethods inherited from interface com.foilen.smalltools.upgrader.tasks.UpgradeTask
execute
-
Field Details
-
jdbcTemplate
@Autowired protected org.springframework.jdbc.core.JdbcTemplate jdbcTemplateThe jdbc template to use.
-
-
Constructor Details
-
AbstractDatabaseUpgradeTask
public AbstractDatabaseUpgradeTask()
-
-
Method Details
-
mysqlTablesFindAll
Find all the tables in the database.- Returns:
- the list of tables
-
purgeConnections
protected void purgeConnections()Purge the connections in the pool. -
updateFromResource
Take a resource file and execute all the queries in it.- Parameters:
resourceName- the name of the resource relative to this class
-
updateFromResource
Take a resource file and execute all the queries in it.- Parameters:
resourceName- the name of the resource relative to the context classresourceCtx- the context class
-
useTracker
Tells the tracker name to use.- Returns:
- the name
-