com.onewebsql.dao
Class DefaultDBAdapterMapper

java.lang.Object
  extended by com.onewebsql.dao.DefaultDBAdapterMapper
All Implemented Interfaces:
DBAdapterMapper

public class DefaultDBAdapterMapper
extends Object
implements DBAdapterMapper

Default database adapter mapper.


Constructor Summary
DefaultDBAdapterMapper(DBAdapter defaultDbAdapter)
          Constructor.
DefaultDBAdapterMapper(Map<String,DBAdapter> dbAdapterMap)
          Constructor.
DefaultDBAdapterMapper(Map<String,DBAdapter> dbAdapterMap, DBAdapter defaultDbAdapter)
          Constructor.
 
Method Summary
 Set<String> getDataSourceNames()
          Returns the set of data source names managed by this mapper.
 DBAdapter getDBAdapter(String dataSourceName)
          Returns the adapter mapper for the specified data source.
 Map<String,DBAdapter> getDBAdapters()
          Returns a map containing all database adapters managed by this mapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDBAdapterMapper

public DefaultDBAdapterMapper(Map<String,DBAdapter> dbAdapterMap)
Constructor.

Parameters:
dbAdapterMap - data source names to database adapter mapping

DefaultDBAdapterMapper

public DefaultDBAdapterMapper(Map<String,DBAdapter> dbAdapterMap,
                              DBAdapter defaultDbAdapter)
Constructor.

Parameters:
dbAdapterMap - data source names to database adapter mapping
defaultDbAdapter - default database adapter (used where no database adapter for the specified data source name is found)).

DefaultDBAdapterMapper

public DefaultDBAdapterMapper(DBAdapter defaultDbAdapter)
Constructor. Creates an adapterMapper which always returns the default adapter

Parameters:
defaultDbAdapter - default database adapter
Method Detail

getDBAdapter

public DBAdapter getDBAdapter(String dataSourceName)
Description copied from interface: DBAdapterMapper
Returns the adapter mapper for the specified data source.

Specified by:
getDBAdapter in interface DBAdapterMapper
Parameters:
dataSourceName - data source
Returns:
the adapter mapper for the specified data source

getDBAdapters

public Map<String,DBAdapter> getDBAdapters()
Description copied from interface: DBAdapterMapper
Returns a map containing all database adapters managed by this mapper.

Specified by:
getDBAdapters in interface DBAdapterMapper
Returns:
a map containg all database adapters managed by this mapper

getDataSourceNames

public Set<String> getDataSourceNames()
Description copied from interface: DBAdapterMapper
Returns the set of data source names managed by this mapper.

Specified by:
getDataSourceNames in interface DBAdapterMapper
Returns:
the set of data source names managed by this mapper.


Copyright © 2011-2013 e-point SA. All Rights Reserved.