#region Apache Notice /***************************************************************************** * $Header: $ * $Revision: 476843 $ * $Date$ * * iBATIS.NET Data Mapper * Copyright (C) 2008/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.Collections; using Apache.Ibatis.DataMapper.Exceptions; using Apache.Ibatis.DataMapper.Model; using Apache.Ibatis.DataMapper.Model.Statements; using Apache.Ibatis.DataMapper.Session; namespace Apache.Ibatis.DataMapper.MappedStatements { /// /// Summary description for UpdateMappedStatement. /// public sealed class UpdateMappedStatement : MappedStatement { /// /// Initializes a new instance of the class. /// /// The model store. /// The statement. public UpdateMappedStatement(IModelStore modelStore, IStatement statement) : base(modelStore, statement) { } #region ExecuteQueryForMap /// /// /// /// /// /// /// /// public override IDictionary ExecuteQueryForMap(ISession session, object parameterObject, string keyProperty, string valueProperty) { throw new DataMapperException("Update statements cannot be executed as a query for map."); } #endregion #region ExecuteInsert /// /// /// /// /// /// public override object ExecuteInsert(ISession session, object parameterObject) { throw new DataMapperException("Update statements cannot be executed as a query insert."); } #endregion #region ExecuteQueryForList /// /// /// /// /// /// public override void ExecuteQueryForList(ISession session, object parameterObject, IList resultObject) { throw new DataMapperException("Update statements cannot be executed as a query for list."); } /// /// /// /// /// /// public override IList ExecuteQueryForList(ISession session, object parameterObject) { throw new DataMapperException("Update statements cannot be executed as a query for list."); } #endregion #region Delegate /// /// /// /// /// /// /// public override IList ExecuteQueryForRowDelegate(ISession session, object parameterObject, RowDelegate rowDelegate) { throw new DataMapperException("Update statement cannot be executed as a query for row delegate."); } /// /// Runs a query with a custom object that gets a chance /// to deal with each row as it is processed. /// /// The session used to execute the statement /// The object used to set the parameters in the SQL. /// The property of the result object to be used as the key. /// The property of the result object to be used as the value (or null) /// /// A hashtable of object containing the rows keyed by keyProperty. ///If a transaction is not in progress, or the database throws an exception. public override IDictionary ExecuteQueryForMapWithRowDelegate(ISession session, object parameterObject, string keyProperty, string valueProperty, DictionaryRowDelegate rowDelegate) { throw new DataMapperException("Update statement cannot be executed as a query for row delegate."); } #endregion #region ExecuteForObject /// /// /// /// /// /// /// public override object ExecuteQueryForObject(ISession session, object parameterObject, object resultObject) { throw new DataMapperException("Update statements cannot be executed as a query for object."); } #endregion } }