/*
* Namespace Summary
* Copyright (C) 2005+ Bogdan Damian Constantin
* E-Mail: damianbcpetro@gmail.com
* WEB: http://www.sourceforge.net/projects/dataholder
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License 2.1 or later, as
* published by the Free Software Foundation. See the included License.txt
* or http://www.gnu.org/copyleft/lesser.html for details.
*
*/
using System;
using System.Data;
using System.Collections;
using System.Text;
namespace DataHolder.DataPersistence.DBAProvider{
/// <summary>
/// Interface for a command provider all the command providers will have
/// to implement it in order to be usable by the framework
/// </summary>
public abstract class CommandProvider
{
public abstract IDbCommand GetEmptyCommand();
public abstract IDbCommand GetSelectCommand(DataHolder.DataPersistence.DBAProvider.GenericDataPropertiesHolder DBAHolder,
FilterSentence sentence, OrderByInfoCollection ordInfo, CommandLockType l_LockType, SelectPhraseOptions SelOptions);
public abstract IDbCommand GetInsertCommand(DataHolder.Containers.GenericData ge, GenericDataPropertiesHolder DBAHolder);
public abstract IDbCommand GetUpdateCommand(DataHolder.Containers.GenericData ge, GenericDataPropertiesHolder DBAHolder);
public abstract IDbCommand GetDeleteCommand(DataHolder.Containers.GenericData ge, GenericDataPropertiesHolder DBAHolder);
public abstract IDbConnection GetConnection(string ConnectionString);
public abstract string GetFromClause(PersistenceProperty persprop, CommandLockType lockType);
public abstract void AddSelectField(ref StringBuilder sb, DBTable [] Tables, Properties.APersistenceField field);
public abstract void AddSaveField(ref StringBuilder sb, DBTable [] Tables, Properties.APersistenceField field);
public abstract void AddParameterField(ref StringBuilder sb, DBTable [] Tables, Properties.APersistenceField field);
public abstract IDbDataParameter AddCommandParameter(IDbCommand cmd, string ParamName, object ParamValue);
public abstract IDbDataParameter GetCommandParameter(IDbCommand cmd, string ParamName);
public virtual void BeforeSaveEntity(System.Data.IDbConnection conn, System.Data.IDbTransaction tran, DataHolder.Containers.GenericData ge, GenericDataPropertiesHolder DBAHolder, object PersistenceInfo)
{
//To Implement If Necessary
}
public virtual void AfterSaveEntity(System.Data.IDbConnection conn, System.Data.IDbTransaction tran, DataHolder.Containers.GenericData ge, GenericDataPropertiesHolder DBAHolder, object PersistenceInfo)
{
//To Implement If Necessary
}
}
}
|