Package com.mckoi.database

## Class DatabaseSystem

- java.lang.Object
- - com.mckoi.database.TransactionSystem
  - - com.mckoi.database.DatabaseSystem

    public final class DatabaseSystem
    extends TransactionSystem

This class provides information about shared resources available for the entire database system running in this VM. Shared information includes configuration details, DataCellCache, plug-ins, user management, etc.

Author:
  Tobias Downer

### Constructor Summary

Constructors
`DatabaseSystem()` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `dispose()` Disposes all the resources associated with this DatabaseSystem and invalidates this object.
`StatementCache` `getStatementCache()` Returns the StatementCache that is used to cache StatementTree objects that are being queried by the database.
`void` `init​(DBConfig config)` Inits the DatabaseSystem with the configuration properties of the system.
`boolean` `logQueries()` If query logging is enabled (all queries are output to 'commands.log' in the log directory), this returns true.
`Transaction.CheckExpression` `prepareTransactionCheckConstraint​(DataTableDef table_def, Transaction.CheckExpression check)` Given a Transaction.CheckExpression, this will prepare the expression and return a new prepared CheckExpression.

### Methods inherited from class com.mckoi.database.TransactionSystem

`addFunctionFactory, alwaysReindexDirtyTables, Debug, dontSynchFileSystem, flushCachedFunctionLookup, getBufferManager, getConfigBoolean, getConfigInt, getConfigString, getDatabasePath, getFunctionLookup, getLogDirectory, getRegexLibrary, ignoreIdentifierCase, lookupComparisonListEnabled, readOnlyAccess, setDebugLevel, setDebugOutput, setLogDirectory, setupRowCache, softIndexStorage, stats, storeSystem, tableLockingEnabled, transactionErrorOnDirtySelect`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DatabaseSystem

    public DatabaseSystem()

Constructor.

### Method Detail

#### init

    public void init​(DBConfig config)

Inits the DatabaseSystem with the configuration properties of the system. This can only be called once, and should be called at database boot time.

Overrides:
  `init` in class `TransactionSystem`

#### logQueries

    public boolean logQueries()

If query logging is enabled (all queries are output to 'commands.log' in the log directory), this returns true. Otherwise it returns false.

#### dispose

    public void dispose()

Disposes all the resources associated with this DatabaseSystem and invalidates this object.

Overrides:
  `dispose` in class `TransactionSystem`

#### getStatementCache

    public StatementCache getStatementCache()

Returns the StatementCache that is used to cache StatementTree objects that are being queried by the database. This is used to reduce the SQL command parsing overhead.

If this method returns 'null' then statement caching is disabled.

#### prepareTransactionCheckConstraint

    public Transaction.CheckExpression prepareTransactionCheckConstraint​(DataTableDef table_def,
                                                                         Transaction.CheckExpression check)

Given a Transaction.CheckExpression, this will prepare the expression and return a new prepared CheckExpression.

A DatabaseSystem resolves the variables (ignoring case if necessary) and the functions of the expression.

Overrides:
  `prepareTransactionCheckConstraint` in class `TransactionSystem`