Exemplo n.º 1
0
        public string TestSql(string tagId, Hashtable p)
        {
            CancelLayout();

            if (!string.IsNullOrEmpty(tagId))
            {
                IBatisNet.DataMapper.Configuration.Statements.IStatement statement =
                    TMM.Persistence.SqlMapper.Get().GetMappedStatement(tagId).Statement;
                IBatisNet.DataMapper.MappedStatements.IMappedStatement mappedStatement =
                    TMM.Persistence.SqlMapper.Instance().GetMappedStatement(tagId);
                IBatisNet.DataMapper.Scope.RequestScope rs =
                    statement.Sql.GetRequestScope(mappedStatement, p, new IBatisNet.DataMapper.SqlMapSession(TMM.Persistence.SqlMapper.Instance()));
                string a = rs.PreparedStatement.PreparedSql;
                return(a);
            }
            return("no sql");
        }
        /// <summary>
        /// Executes the specified <see cref="PostBindind"/>.
        /// </summary>
        /// <param name="postSelect">The <see cref="PostBindind"/>.</param>
        /// <param name="request">The <see cref="RequestScope"/></param>
        public void Execute(PostBindind postSelect, IBatisNet.DataMapper.Scope.RequestScope request)
        {
            DataTable value = postSelect.Statement.ExecuteQueryForDataTable(request.Session, postSelect.Keys);

            postSelect.ResultProperty.SetAccessor.Set(postSelect.Target, value);
        }