com.onewebsql.dao
Interface DaoManager

All Known Implementing Classes:
DefaultDaoManager

public interface DaoManager

DAO manager interface.


Method Summary
<T> T
getDao(Class<T> daoClass)
          Returns a DAO object implementing the specified DAO interface.
<T> T
getDao(Class<T> daoClass, String schemaName)
          Returns a DAO object implementing the specified DAO interface using the specified schema name.
<T> T
getDao(Class<T> daoClass, String dataSourceName, String schemaName)
          Returns a DAO object implementing the specified DAO interface using the data source and the specified schema name.
 DaoMonitor getDaoMonitor()
          Returns the dao monitor of this DaoManager.
 DataSourceManager getDataSourceManager()
          Returns the data source manager of this DaoManager.
 DBAdapterMapper getDbAdapterMapper()
          Returns the database adapter mapper of this DaoManager.
 

Method Detail

getDao

<T> T getDao(Class<T> daoClass)
Returns a DAO object implementing the specified DAO interface. The returned DAO object uses a default data source. Example usage:
DaoManager daoManager = new DefaultDaoManager(ds, new PostgresDBAdapter());
daoManager.getDao(BookDAO.class);
     

Parameters:
daoClass - DAO object interface
Returns:
returns a DAO object for the specified class

getDao

<T> T getDao(Class<T> daoClass,
             String schemaName)
Returns a DAO object implementing the specified DAO interface using the specified schema name. The returned DAO object uses a default data source. If the schema name is null then the schema name is not used by DAO object. Example usage:
DaoManager daoManager = new DefaultDaoManager(ds, new PostgresDBAdapter());
daoManager.getDao(BookDAO.class, "schemaname");
     

Parameters:
daoClass - DAO object interface
schemaName - the name of the schema for the specified DAO's table. Might be null.
Returns:
returns a DAO object for the specified class

getDao

<T> T getDao(Class<T> daoClass,
             String dataSourceName,
             String schemaName)
Returns a DAO object implementing the specified DAO interface using the data source and the specified schema name. If the schema name is null then the schema name is not used by DAO object. Example usage:
DaoManager daoManager = new DefaultDaoManager(ds, new PostgresDBAdapter());
daoManager.getDao(BookDAO.class, "datasourcename", "schemaname");
     

Parameters:
daoClass - DAO object interface
dataSourceName - datasource name
schemaName - the name of the schema for the specified DAO's table. Might be null.
Returns:
returns a DAO object for the specified class, using the given data source

getDataSourceManager

DataSourceManager getDataSourceManager()
Returns the data source manager of this DaoManager.

Returns:
data source manager

getDbAdapterMapper

DBAdapterMapper getDbAdapterMapper()
Returns the database adapter mapper of this DaoManager.

Returns:
database adapter mapper

getDaoMonitor

DaoMonitor getDaoMonitor()
Returns the dao monitor of this DaoManager.

Returns:
dao monitor


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