com.scooterframework.orm.sqldataexpress.util
Class DBStore

java.lang.Object
  extended by com.scooterframework.orm.sqldataexpress.util.DBStore

public class DBStore
extends java.lang.Object

DBStore class serves as an in-memory cache for some frequently used objects.


Method Summary
 void addDBAdapter(java.lang.String connName, DBAdapter dba)
           
 void addFunction(java.lang.String name, Function function)
           
 void addJdbcStatement(java.lang.String name, JdbcStatement jdbcStmt)
           
 void addJdbcStatementProcessor(java.lang.String name, JdbcStatementProcessor jdbcProcessor)
           
 void addPrimaryKey(java.lang.String connName, java.lang.String tableName, PrimaryKey pk)
          Adds an instance of PrimaryKey
 void addPrimaryKey(java.lang.String connName, java.lang.String catalog, java.lang.String schema, java.lang.String tableName, PrimaryKey pk)
          Adds an instance of PrimaryKey
 void addStoredProcedure(java.lang.String name, StoredProcedure spoc)
           
 void addTableInfo(java.lang.String connName, java.lang.String catalog, java.lang.String schema, java.lang.String tableName, TableInfo ti)
          Adds an instance of TableInfo
 void addTableInfo(java.lang.String connName, java.lang.String tableName, TableInfo ti)
          Adds an instance of TableInfo
 java.util.Map<java.lang.String,DBAdapter> getAdapters()
           
 DBAdapter getDBAdapter(java.lang.String connName)
           
 Function getFunction(java.lang.String name)
           
 java.util.Map<java.lang.String,Function> getFunctions()
           
static DBStore getInstance()
           
 JdbcStatement getJdbcStatement(java.lang.String name)
           
 JdbcStatementProcessor getJdbcStatementProcessor(java.lang.String name)
           
 java.util.Map<java.lang.String,JdbcStatementProcessor> getJdbcStatementProcessors()
           
 java.util.Map<java.lang.String,JdbcStatement> getJdbcStatements()
           
 PrimaryKey getPrimaryKey(java.lang.String connName, java.lang.String tableName)
          Retrieves a stored PrimaryKey instance.
 PrimaryKey getPrimaryKey(java.lang.String connName, java.lang.String catalog, java.lang.String schema, java.lang.String tableName)
          Retrieves a stored PrimaryKey instance.
 StoredProcedure getStoredProcedure(java.lang.String name)
           
 java.util.Map<java.lang.String,StoredProcedure> getStoredProcedures()
           
 TableInfo getTableInfo(java.lang.String connName, java.lang.String tableName)
          Retrieves a stored TableInfo instance.
 TableInfo getTableInfo(java.lang.String connName, java.lang.String catalog, java.lang.String schema, java.lang.String tableName)
          Retrieves a stored TableInfo instance.
 java.util.Map<java.lang.String,TableInfo> getTableInfos()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DBStore getInstance()

getStoredProcedures

public java.util.Map<java.lang.String,StoredProcedure> getStoredProcedures()

getStoredProcedure

public StoredProcedure getStoredProcedure(java.lang.String name)

addStoredProcedure

public void addStoredProcedure(java.lang.String name,
                               StoredProcedure spoc)

getFunctions

public java.util.Map<java.lang.String,Function> getFunctions()

getFunction

public Function getFunction(java.lang.String name)

addFunction

public void addFunction(java.lang.String name,
                        Function function)

getJdbcStatements

public java.util.Map<java.lang.String,JdbcStatement> getJdbcStatements()

getJdbcStatement

public JdbcStatement getJdbcStatement(java.lang.String name)

addJdbcStatement

public void addJdbcStatement(java.lang.String name,
                             JdbcStatement jdbcStmt)

getJdbcStatementProcessors

public java.util.Map<java.lang.String,JdbcStatementProcessor> getJdbcStatementProcessors()

getJdbcStatementProcessor

public JdbcStatementProcessor getJdbcStatementProcessor(java.lang.String name)

addJdbcStatementProcessor

public void addJdbcStatementProcessor(java.lang.String name,
                                      JdbcStatementProcessor jdbcProcessor)

getTableInfos

public java.util.Map<java.lang.String,TableInfo> getTableInfos()

getTableInfo

public TableInfo getTableInfo(java.lang.String connName,
                              java.lang.String catalog,
                              java.lang.String schema,
                              java.lang.String tableName)
Retrieves a stored TableInfo instance.

Parameters:
connName - database connection name
catalog - catalog name
schema - schema name
tableName - table name
Returns:
instance of TableInfo

addTableInfo

public void addTableInfo(java.lang.String connName,
                         java.lang.String catalog,
                         java.lang.String schema,
                         java.lang.String tableName,
                         TableInfo ti)
Adds an instance of TableInfo

Parameters:
connName - database connection name
catalog - catalog name
schema - schema name
tableName - table name
ti - instance of TableInfo

getTableInfo

public TableInfo getTableInfo(java.lang.String connName,
                              java.lang.String tableName)
Retrieves a stored TableInfo instance.

Parameters:
connName - database connection name
tableName - table name
Returns:
instance of TableInfo

addTableInfo

public void addTableInfo(java.lang.String connName,
                         java.lang.String tableName,
                         TableInfo ti)
Adds an instance of TableInfo

Parameters:
connName - database connection name
tableName - table name
ti - instance of TableInfo

getPrimaryKey

public PrimaryKey getPrimaryKey(java.lang.String connName,
                                java.lang.String catalog,
                                java.lang.String schema,
                                java.lang.String tableName)
Retrieves a stored PrimaryKey instance.

Parameters:
connName - database connection name
catalog - catalog name
schema - schema name
tableName - table name
Returns:
instance of PrimaryKey

addPrimaryKey

public void addPrimaryKey(java.lang.String connName,
                          java.lang.String catalog,
                          java.lang.String schema,
                          java.lang.String tableName,
                          PrimaryKey pk)
Adds an instance of PrimaryKey

Parameters:
connName - database connection name
catalog - catalog name
schema - schema name
tableName - table name
pk - instance of PrimaryKey

getPrimaryKey

public PrimaryKey getPrimaryKey(java.lang.String connName,
                                java.lang.String tableName)
Retrieves a stored PrimaryKey instance.

Parameters:
connName - database connection name
tableName - table name
Returns:
instance of PrimaryKey

addPrimaryKey

public void addPrimaryKey(java.lang.String connName,
                          java.lang.String tableName,
                          PrimaryKey pk)
Adds an instance of PrimaryKey

Parameters:
connName - database connection name
tableName - table name
pk - instance of PrimaryKey

getAdapters

public java.util.Map<java.lang.String,DBAdapter> getAdapters()

getDBAdapter

public DBAdapter getDBAdapter(java.lang.String connName)

addDBAdapter

public void addDBAdapter(java.lang.String connName,
                         DBAdapter dba)