Package de.chojo.sqlutil.databases
Class DefaultType<T extends JdbcConfig<?>>
java.lang.Object
de.chojo.sqlutil.databases.DefaultType<T>
- Type Parameters:
T- database type defined by theSqlType
- All Implemented Interfaces:
SqlType<T>
Represents a default database
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateVersionTableQuery(String table) Creates a query to create a version table on the database.deleteVersion(String table) Creates a query to delete all entries from the version table.getVersion(String table) Gets a query to read the version from the version tableinsertVersion(String table) Creates a query to insert a version into the version table.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.chojo.sqlutil.databases.SqlType
cleanStatements, createSchema, getName, hasSchemas, jdbcBuilder, schemaExists, splitStatements
-
Constructor Details
-
DefaultType
public DefaultType()
-
-
Method Details
-
getVersion
Description copied from interface:SqlTypeGets a query to read the version from the version table- Specified by:
getVersionin interfaceSqlType<T extends JdbcConfig<?>>- Parameters:
table- table name- Returns:
- query to read the version table
-
insertVersion
Description copied from interface:SqlTypeCreates a query to insert a version into the version table.Versions are always inserted and not updated.
- Specified by:
insertVersionin interfaceSqlType<T extends JdbcConfig<?>>- Parameters:
table- table name- Returns:
- query to insert the version.
-
deleteVersion
Description copied from interface:SqlTypeCreates a query to delete all entries from the version table.- Specified by:
deleteVersionin interfaceSqlType<T extends JdbcConfig<?>>- Parameters:
table- table name- Returns:
- query to clear version table
-
createVersionTableQuery
Description copied from interface:SqlTypeCreates a query to create a version table on the database.The query needs to handle errors when the table exists.
- Specified by:
createVersionTableQueryin interfaceSqlType<T extends JdbcConfig<?>>- Parameters:
table- table name- Returns:
- query to create a version table
-