com.nec.tdd.tools.dbMapper
Class DBMapper

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

public class DBMapper
extends java.lang.Object

Imp Note: This class should be moved to a user package. Keeping it for old code compatibility.

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 connection_info files for different 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
 DBInterface getDBInterface()
          Get shared DBInterface associated with singleton DBMapper.
static DBMapper getInstance()
          Method to return singleton/shared DBMapper instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DBMapper getInstance()
Method to return singleton/shared DBMapper instance. If shared instance has not been already created, this method creates one and initializes the connection manager, ORMappingInfo and database interface objects.
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.
Returns:
the singleton DBMapper instance.

getDBInterface

public DBInterface getDBInterface()
Get shared DBInterface associated with singleton DBMapper. If shared instance has not been already created, this method creates one and initializes the connection manager, ORMappingInfo and database interface objects from data-source and or mapping (xml) files.
Returns:
the singleton/shared DBMapper instance.