Module watamebot

Class AbstractDatabase

java.lang.Object
net.foxgenesis.watame.sql.AbstractDatabase
All Implemented Interfaces:
AutoCloseable

@Deprecated(forRemoval=true) public class AbstractDatabase extends Object implements AutoCloseable
Deprecated, for removal: This API element is subject to removal in a future version.
NEED_JAVADOC
Author:
Ashley
  • Field Details

    • logger

      @Nonnull protected final org.slf4j.Logger logger
      Deprecated, for removal: This API element is subject to removal in a future version.
      Database logger
    • source

      @Nonnull protected DataSource source
      Deprecated, for removal: This API element is subject to removal in a future version.
      SQL connection pool
  • Constructor Details

    • AbstractDatabase

      public AbstractDatabase(@Nonnull DatabaseProperties properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      properties -
  • Method Details

    • setup

      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Throws:
      SQLException
      UnsupportedOperationException
      IOException
    • getRawStatement

      @CheckForNull protected String getRawStatement(String id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      id -
      Returns:
    • assertRawStatement

      @Nullable protected String assertRawStatement(String id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      id -
      Returns:
    • getRawCallableStatement

      @CheckForNull protected String getRawCallableStatement(String id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      id -
      Returns:
    • assertRawCallableStatement

      @Nullable protected String assertRawCallableStatement(String id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      id -
      Returns:
    • mapStatement

      protected <R> R mapStatement(@Nonnull String id, @Nonnull AbstractDatabase.StatementFunction<R> function)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Type Parameters:
      R -
      Parameters:
      id -
      function -
      Returns:
    • mapStatement

      protected <R> R mapStatement(String id, @Nonnull AbstractDatabase.StatementFunction<R> function, Consumer<SQLException> errorHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Type Parameters:
      R -
      Parameters:
      id -
      function -
      Returns:
    • mapCallableStatement

      protected <R> R mapCallableStatement(@Nonnull String id, @Nonnull AbstractDatabase.CallableStatementFunction<R> function)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Type Parameters:
      R -
      Parameters:
      id -
      function -
      Returns:
    • mapCallableStatement

      protected <R> R mapCallableStatement(String id, @Nonnull AbstractDatabase.CallableStatementFunction<R> function, Consumer<SQLException> errorHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Type Parameters:
      R -
      Parameters:
      id -
      function -
      Returns:
    • executeStatement

      protected void executeStatement(@Nonnull String id, @Nonnull AbstractDatabase.StatementConsumer consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      id -
      consumer -
    • executeStatement

      protected void executeStatement(@Nonnull String id, @Nonnull AbstractDatabase.StatementConsumer consumer, Consumer<SQLException> errorHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      id -
      consumer -
      errorHandler -
    • executeCallableStatement

      protected void executeCallableStatement(@Nonnull String id, @Nonnull AbstractDatabase.CallableStatementConsumer consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      id -
      consumer -
    • executeCallableStatement

      protected void executeCallableStatement(@Nonnull String id, @Nonnull AbstractDatabase.CallableStatementConsumer consumer, Consumer<SQLException> errorHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      id -
      consumer -
      errorHandler -
    • addCloseHandler

      public void addCloseHandler(Runnable onClose)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      onClose -
    • removeCloseHandler

      public void removeCloseHandler(Runnable toRemove)
      Deprecated, for removal: This API element is subject to removal in a future version.
      NEED_JAVADOC
      Parameters:
      toRemove -
    • close

      public void close() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object