Nhibernate/Hibernate 使用存儲過程 多參數設置

2021-06-21 06:05

阅读:621

标签:color   collect   pac   div   using   manager   1.0   start   and   

xml version="1.0" encoding="utf-8" ?>
hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Mrp.Domain" assembly="Mrp.Domain">

class name="GetQpmrpWorkDomain">
id name="ActualStart">
id>
property name="ActualFinish" column="ActualFinish"/> 
property name="status" column="status"/>
class>
sql-query name="GetQpmrpWorkDomainListByParam">
return alias="GetQpmrpWorkDomain" class="Mrp.Domain.GetQpmrpWorkDomain"/>
[CDATA[
exec dbo.p_pms_get_qpmrp_work_info :projectid,:taskid,:info_code,:expandargs,:p_companyid
]]>
sql-query>
hibernate-mapping>

 
using Mrp.IBLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;
using ServiceLocation;
using Mrp.Domain;

namespace Mrp.BLL
{
    public class GetQpmrpWorkManager : IGetQpmrpWorkManager
    {
        IDataAccess da = Locator.Current.GetObject();

        public IList GetList(string projectid,string taskid,string info_code,string expandargs,string p_companyid)
        {
            projectid = "";
            NamedQuery namedQuery = new NamedQuery("GetQpmrpWorkDomainListByParam"); 
            namedQuery.AddParameter("projectid", projectid);
            namedQuery.AddParameter("taskid", taskid);
            namedQuery.AddParameter("info_code", info_code);
            namedQuery.AddParameter("expandargs", expandargs);
            namedQuery.AddParameter("p_companyid", p_companyid);
            return da.GetList(namedQuery);
        }
    }
}

 

 

Nhibernate/Hibernate 使用存儲過程 多參數設置

标签:color   collect   pac   div   using   manager   1.0   start   and   

原文地址:http://www.cnblogs.com/YzpJason/p/7183325.html


评论


亲,登录后才可以留言!