#region Apache Notice
/*****************************************************************************
* $Revision: 374175 $
* $LastChangedDate: 2006-03-22 22:39:21 +0100 (mer., 22 mars 2006) $
* $LastChangedBy: gbayon $
*
* iBATIS.NET Data Mapper
* Copyright (C) 2006/2005 - The Apache Software Foundation
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************/
#endregion
using System;
using System.Data;
using IBatisNet.Common;
using IBatisNet.DataAccess.Interfaces;
using IBatisNet.DataAccess.SessionStore;
namespace IBatisNet.DataAccess
{
///
/// Contract for a dao manager
///
public interface IDaoManager
{
///
/// Name used to identify the the
///
string Id { get;set; }
///
/// Allow to set a custom session store like the
///
/// Set it after the configuration and before use of the
///
/// daoManager.SessionStore = new HybridWebThreadSessionStore( daoManager.Id );
///
ISessionStore SessionStore { set; }
///
/// Begins a database transaction with the specified isolation level.
///
///
/// The isolation level under which the transaction should run.
///
/// A IDalSession.
IDalSession BeginTransaction(IsolationLevel isolationLevel);
///
/// Begins a database transaction.
///
/// A IDalSession
IDalSession BeginTransaction();
///
/// Close a connection
///
void CloseConnection();
///
/// Commits the database transaction.
///
///
/// Auto close the connection.
///
void CommitTransaction();
///
/// Gets a Dao instance for the requested interface type.
///
/// The requested interface type.
/// A Dao instance
IDao GetDao(Type daoInterface);
///
/// Get a new DaoSession
///
/// A new DaoSession
DaoSession GetDaoSession();
///
/// Determines whether [is DAO session started].
///
///
/// true if [is DAO session started]; otherwise, false.
///
bool IsDaoSessionStarted();
///
/// Gets the local DAO session.
///
/// The local DAO session.
IDalSession LocalDaoSession { get; }
///
/// Gets the local data source.
///
/// The local data source.
IDataSource LocalDataSource { get; }
///
/// Open a connection, on the specified connection string.
///
/// The connection string
IDalSession OpenConnection(string connectionString);
///
/// Open a connection.
///
/// A IDalSession.
IDalSession OpenConnection();
///
/// Rolls back a transaction from a pending state.
///
///
/// Close the connection.
///
void RollBackTransaction();
///
/// Gets a Dao instance for the requested interface type.
///
IDao this[Type daoInterface] { get; }
}
}