com.nec.tdd.tools.dbMapper
Class DBModule

java.lang.Object
  |
  +--com.nec.tdd.tools.dbMapper.DBModule

public class DBModule
extends java.lang.Object

A singelton class, which manages a single database interface (DBInterface) object, that can be used to create, update, delete and locate user objects to and from a database.

The database connection manager and ORMappingInfo associated with the DBInterface is created and initialized from a data-source and or-mapping xml files (respectively) kept in well known user directories.

Typically, an application system will create several OR mapping files (at least one for each process, and may be more per module). Also they will have different data-source files for different relational databases used by system. Depending on the need, the application programmers should create more than one DBInterface object per process, and customize database connection manager properties (e.g. pool initial capacity and increment etc).


Method Summary
 DefaultMapper createDefaultMapper(java.lang.String mappingContextId)
           
static DBModule init()
          Initialize DBModule without specifying any mapper configuration.
static DBModule init(java.lang.String configXMLFile)
          Initialize DBModule from mapper xml file pointed by the configXMLFile.
static DBModule init(java.lang.String startingDir, java.lang.String configXMLFile)
          Initialize DBModule from mapper xml file pointed by startingDir directory and file path (configXMLFile).
static DBModule init(java.net.URL configXMLURL)
          Initialize DBModule from mapper xml file pointed by the configXMLURL.
 void validate(boolean isDBCheckEnabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static DBModule init(java.lang.String startingDir,
                            java.lang.String configXMLFile)
                     throws java.lang.Exception
Initialize DBModule from mapper xml file pointed by startingDir directory and file path (configXMLFile).
Parameters:
startingDir - Starting directory relative to which the xml files are loaded by DBModule. Starting directory can be an absolute path to a directory or a relative path to process run directory. For jar files the starting directory must refer to an absolute path.

init

public static DBModule init(java.lang.String configXMLFile)
                     throws java.lang.Exception
Initialize DBModule from mapper xml file pointed by the configXMLFile. All the xml files (including the mapper file) will be loaded to the process run directory. This method is equivalent to init(".",configXMLFile)

init

public static DBModule init(java.net.URL configXMLURL)
                     throws java.lang.Exception
Initialize DBModule from mapper xml file pointed by the configXMLURL. All the files referenced by mapper xml file will be loaded from the process run directory or the jar file.

init

public static DBModule init()
Initialize DBModule without specifying any mapper configuration. DB module is initialized without any mapping context or data sources.

createDefaultMapper

public DefaultMapper createDefaultMapper(java.lang.String mappingContextId)
                                  throws java.lang.Exception

validate

public void validate(boolean isDBCheckEnabled)
              throws java.lang.Exception