Class DatabaseQueryContext

  • All Implemented Interfaces:
    QueryContext

    public class DatabaseQueryContext
    extends AbstractQueryContext
    An implementation of a QueryContext based on a DatabaseConnection object.
    Author:
    Tobias Downer
    • Constructor Detail

      • DatabaseQueryContext

        public DatabaseQueryContext​(DatabaseConnection database)
        Constructs the QueryContext.
    • Method Detail

      • getDatabase

        public Database getDatabase()
        Returns the Database object that this context is a child of.
      • getSystem

        public TransactionSystem getSystem()
        Returns a TransactionSystem object that is used to determine information about the transactional system.
      • getFunctionLookup

        public FunctionLookup getFunctionLookup()
        Returns the system FunctionLookup object.
      • getGrantManager

        public GrantManager getGrantManager()
        Returns the GrantManager object that is used to determine grant information for the database.
      • getTable

        public DataTable getTable​(TableName name)
        Returns a DataTable from the database with the given table name.
      • getDataTableDef

        public DataTableDef getDataTableDef​(TableName name)
        Returns a DataTableDef for the given table name.
      • createViewQueryPlanNode

        public QueryPlanNode createViewQueryPlanNode​(TableName name)
        Creates a QueryPlanNode for the view with the given name.
      • nextSequenceValue

        public long nextSequenceValue​(java.lang.String name)
        Increments the sequence generator and returns the next unique key.
      • currentSequenceValue

        public long currentSequenceValue​(java.lang.String name)
        Returns the current sequence value returned for the given sequence generator within the connection defined by this context. If a value was not returned for this connection then a statement exception is generated.
      • setSequenceValue

        public void setSequenceValue​(java.lang.String name,
                                     long value)
        Sets the current sequence value for the given sequence generator.
      • getUserName

        public java.lang.String getUserName()
        Returns the user name of the connection.