Ejemplo n.º 1
0
        /// <summary>
        /// Execute SQL with batch result list return
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="statementName"></param>
        /// <param name="parameterObject"></param>
        /// <param name="batch"></param>
        /// <param name="listDelegate"></param>
        /// <returns></returns>
        protected IList <T> ExecuteQueryForList <T>(string statementName, object parameterObject, int batch,
                                                    ResultListDelegate <T> listDelegate)
        {
            ISqlMapper sqlMap = GetLocalSqlMap();

            try
            {
                if (needDirtyRead && ContainsDirtyReadStatement())
                {
                    SetDirtyRead();
                }

                return(sqlMap.QueryForList(statementName, parameterObject, batch, listDelegate));
            }
            catch (Exception e)
            {
                Trace.Write(e.Message + "\n" + e.StackTrace);
                throw new IBatisNetException(
                          "Error executing query '" + statementName + "' for list.  Cause: " + e.Message, e);
            }
        }
 /// <summary>
 /// No supported method for CachingStatement
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="session"></param>
 /// <param name="parameterObject"></param>
 /// <param name="batch"></param>
 /// <param name="listDelegate"></param>
 /// <returns></returns>
 public IList <T> ExecuteQueryForList <T>(ISqlMapSession session, object parameterObject, int batch, ResultListDelegate <T> listDelegate)
 {
     throw new Exception("No supported method!");
 }