DaoManager is a facade class that provides convenient access to the rest of the DAO framework. It's primary responsibilities include: - Reading configuration information and initializing the framework - Managing different contexts for different configurations - Providing access to Dao implementation - Providing access to the DaoSession pool for connections, transactions
For a list of all members of this type, see DaoManager Members.
System.Object
DaoManager
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Exemple 1: IDaoManager daoManager = DaoManager.GetInstance("PetStore"); ICategoryDao categoryDao = (ICategoryDao) daoManager.GetDao("Category"); DaoSession daoSession = daoManager.GetDaoSession(); daoSession.OpenConnection(); ArrayList categoryList = categoryGetCategoryList(5,daoSession); daoSession.CloseConnection(daoSession); Exemple 2: IDaoManager daoManager = DaoManager.GetInstance("PetStore"); ICategoryDao categoryDao = (ICategoryDao) daoManager.GetDao("Category"); daoManager.OpenConnection(); ArrayList categoryList = categoryGetCategoryList(5); daoManager.CloseConnection(); Exemple 3: Product p1 = new Product(); Product p2 = new Product(); Category c 1= new Category() c1.Add(p1); c2.Add(p2); IDaoManager daoManager = DaoManager.GetInstance("PetStore"); ICategoryDao categoryDao = (ICategoryDao) daoManager.GetDao("Category"); IProductDao productDao = (IProductDao) daoManager.GetDao("Product"); daoManager.BeginTransaction(); try { productInsert(p1); productInsert(p2); categoryInsert(c1); daoManager.CommitTransaction(); } catch { daoManager.RollBackTransaction(); }
Namespace: IBatisNet.DataAccess
Assembly: IBatisNet.DataAccess (in IBatisNet.DataAccess.dll)
DaoManager Members | IBatisNet.DataAccess Namespace