Hi All,
I am getting the error NHibernate.QueryException: in expected:
when i try to map my class using nHibernate.
NHibernate.QueryException: in expected: pReg [select pReg from PartyRegistry pReg where pReg.PartyId = ?].
this is my .hbm class
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="~~~~~~~~~~~~~~~~~"
namespace="~~~~~~~~~~~~~~~~">
<class name="PartyRegistry" table="~~~~~~~~~~~~~~">
<id name="PartyId" column="Party_PartyId_Patient" type="Int32">
<generator class="foreign">
<param name="property">Party</param>
</generator>
</id>
<many-to-one name="Party" class="~~~~~~~~~~~~.Party" constrained="true" />
</class>
</hibernate-mapping>
-----------------
and my entity class is:
public class ABC : EntityBase
{
public virtual Int32 PartyId { get; set; }
public static ABC GetResultForPartyId(IPersistenceService persistenceService, Int32 partyId)
{
ISession session = persistenceService.Session as ISession;
return (ABC)session.CreateQuery(" from ABC pReg where pReg.PartyId = ?").SetInt32(0, partyId).UniqueResult<ABC>();
}
}
_________________ regards
John
|