Nhibernate exception - No persister for
Posted
by Muhammad Akhtar
on Stack Overflow
See other posts from Stack Overflow
or by Muhammad Akhtar
Published on 2010-04-22T05:24:37Z
Indexed on
2010/04/22
5:33 UTC
Read the original article
Hit count: 1041
I am getting exception when calling Stored Procedure using Nhibernate and here is the exception
No persister for: ReleaseDAL.ProgressBars, ReleaseDAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
here is class file
public class ProgressBars
{
public ProgressBars()
{ }
private Int32 _Tot;
private Int32 _subtot;
public virtual Int32 Tot {get { return _Tot; } set { _Tot = value; } }
public virtual Int32 subtot { get { return _subtot; } set { _subtot = value; }}
}
here is my mapping file
<hibernate-mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:nhibernate-mapping-2.2"
assembly="ReleaseDAL" namespace="ReleaseDAL" >
<sql-query name="ps_getProgressBarData1" >
<return alias="ProgressBars" class="ProgressBars">
<return-property name="Tot" column="Tot"/>
<return-property name="subtot" column="subtot"/>
</return>
exec ps_getProgressBarData1
</sql-query>
</hibernate-mapping>
Calling Code
public List<ProgressBars> getProgressBarData1(Guid ReleaseId)
{
ISession session = NHibernateHelper.GetCurrentSession();
List< ProgressBars> progressBar = (List<ProgressBars>)session.GetNamedQuery("ps_getProgressBarData1").List<ProgressBars>();
NHibernateHelper.CloseSession();
return progressBar;
}
I am introuble due to this exception, I did lot Google but no success, Please give idea to solve this problem.
Thanks.........
© Stack Overflow or respective owner