org.tmatesoft.sqljet.core.map
Class SqlJetMapDb

java.lang.Object
  extended by org.tmatesoft.sqljet.core.table.engine.SqlJetEngine
      extended by org.tmatesoft.sqljet.core.map.SqlJetMapDb

public class SqlJetMapDb
extends SqlJetEngine


Field Summary
static java.io.File IN_MEMORY
          File name for in memory database.
static java.lang.String MODULE_NAME
           
 
Fields inherited from class org.tmatesoft.sqljet.core.table.engine.SqlJetEngine
btree, dbHandle, file, FILE_SYSTEM_MANAGER, fileSystem, open, writable
 
Constructor Summary
SqlJetMapDb(java.io.File file, boolean writable)
           
 
Method Summary
 ISqlJetMapDef createMap(java.lang.String mapName)
           
 ISqlJetMap getMap(java.lang.String mapName)
           
 ISqlJetMapDef getMapDef(java.lang.String mapName)
           
 java.util.Set<java.lang.String> getMapNames()
           
static SqlJetMapDb open(java.io.File file, boolean writable)
           
protected  void readSchema()
          Reads database schema and options.
 java.lang.Object runReadTransaction(ISqlJetMapTransaction transaction)
           
 java.lang.Object runSynchronized(ISqlJetMapTransaction transaction)
           
 java.lang.Object runTransaction(SqlJetTransactionMode mode, ISqlJetMapTransaction transaction)
           
 java.lang.Object runWriteTransaction(ISqlJetMapTransaction transaction)
           
 
Methods inherited from class org.tmatesoft.sqljet.core.table.engine.SqlJetEngine
beginTransaction, checkOpen, close, closeResources, commit, finalize, getBusyHandler, getCacheSize, getFile, getFileSystem, getJournalMode, getMutex, getOptions, getSafetyLevel, getSchemaInternal, getTransactionMode, isInTransaction, isOpen, isWritable, open, refreshSchema, registerFileSystem, rollback, runEngineTransaction, runSynchronized, setBusyHandler, setCacheSize, setJournalMode, setSafetyLevel, unregisterFileSystem
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IN_MEMORY

public static final java.io.File IN_MEMORY
File name for in memory database.


MODULE_NAME

public static final java.lang.String MODULE_NAME
See Also:
Constant Field Values
Constructor Detail

SqlJetMapDb

public SqlJetMapDb(java.io.File file,
                   boolean writable)
Parameters:
file - database file.
writable - true if caller needs write access to the database.
Method Detail

open

public static SqlJetMapDb open(java.io.File file,
                               boolean writable)
                        throws SqlJetException
Throws:
SqlJetException

runTransaction

public java.lang.Object runTransaction(SqlJetTransactionMode mode,
                                       ISqlJetMapTransaction transaction)
                                throws SqlJetException
Parameters:
mode - mode in which to run transaction.
transaction - transaction to run.
Returns:
result of ISqlJetMapTransaction.run(SqlJetMapDb) call.
Throws:
SqlJetException

runWriteTransaction

public java.lang.Object runWriteTransaction(ISqlJetMapTransaction transaction)
                                     throws SqlJetException
Parameters:
transaction - to run.
Returns:
result of ISqlJetMapTransaction.run(SqlJetMapDb) call.
Throws:
SqlJetException

runReadTransaction

public java.lang.Object runReadTransaction(ISqlJetMapTransaction transaction)
                                    throws SqlJetException
Parameters:
transaction - transaction to run.
Returns:
result of ISqlJetMapTransaction.run(SqlJetMapDb) call.
Throws:
SqlJetException

runSynchronized

public java.lang.Object runSynchronized(ISqlJetMapTransaction transaction)
                                 throws SqlJetException
Parameters:
transaction - transaction to run.
Returns:
result of ISqlJetMapTransaction.run(SqlJetMapDb) call.
Throws:
SqlJetException

readSchema

protected void readSchema()
                   throws SqlJetException
Description copied from class: SqlJetEngine
Reads database schema and options.

Overrides:
readSchema in class SqlJetEngine
Throws:
SqlJetException

getMapNames

public java.util.Set<java.lang.String> getMapNames()
                                            throws SqlJetException
Returns:
set of the map names stored in this database.
Throws:
SqlJetException

getMapDef

public ISqlJetMapDef getMapDef(java.lang.String mapName)
                        throws SqlJetException
Parameters:
mapName - name of the map to get definition for.
Returns:
definition of the map with the specified name.
Throws:
SqlJetException

createMap

public ISqlJetMapDef createMap(java.lang.String mapName)
                        throws SqlJetException
Parameters:
mapName - name of the map to created.
Returns:
map that has been created.
Throws:
SqlJetException

getMap

public ISqlJetMap getMap(java.lang.String mapName)
                  throws SqlJetException
Parameters:
mapName - name of the map to get.
Returns:
map table with the name specified.
Throws:
SqlJetException