Nhibernate/Hibernate 使用存儲過程 多參數設置
Posted 编程路上的青铜五
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nhibernate/Hibernate 使用存儲過程 多參數設置相关的知识,希望对你有一定的参考价值。
<?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<IDataAccess>(); public IList<GetQpmrpWorkDomain> 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<GetQpmrpWorkDomain>(namedQuery); } } }
![CDATA[ exec>!--?xml>
以上是关于Nhibernate/Hibernate 使用存儲過程 多參數設置的主要内容,如果未能解决你的问题,请参考以下文章