Interface Database

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Database.State
      Possible State changes: CLOSED to PATCHING (Database init), PATCHING to OPEN (Database initialized), OPEN to CLOSING (Database closing), CLOSING to CLOSED (Database closed), PATCHING to CLOSED (Database closed prematurely)
    • Method Detail

      • init

        void init()
        Initializes the Database.

        Queries can be performed after this request has completed all required transactions for the database operations.

        Throws:
        DBInitException - if Database fails to initiate.
      • close

        void close()
      • query

        <T> T query​(Query<T> query)
        Execute an SQL Query statement to get a result.

        This method should only be called from an asynchronous thread.

        Type Parameters:
        T - Type of the object to be returned.
        Parameters:
        query - QueryStatement to execute.
        Returns:
        Result of the query.
      • executeTransaction

        java.util.concurrent.Future<?> executeTransaction​(Transaction transaction)
        Execute an SQL Transaction.
        Parameters:
        transaction - Transaction to execute.
        Returns:
        Future that is finished when the transaction has been executed.
      • getType

        DBType getType()
        Used to get the DBType of the Database
        Returns:
        the DBType
        See Also:
        DBType
      • getSql

        default Sql getSql()