Nhibernate 问题 “path expected for join!”
小弟最近在搞Nhibernate,遇到这样一个问题,比较棘手。
类:
public class Blpsitm
{
public Blpsitm()
{
}
public Blpsitm(string itemcode)
{
this.ItemCode = itemcode;
}
#region 产品信息 Product Information
/// <summary>
/// 产品代码
/// </summary>
public virtual string ItemCode { get; set; }
/// <summary>
/// 注册证号
/// </summary>
public virtual string Registered { get; set; }
/// <summary>
/// 批准文号
/// </summary>
public virtual string Licensedid { get; set; }
/// <summary>
/// 品名
/// </summary>
public virtual string DrugName { get; set; }
#endregion
}
public class CurrentlyInfo
{
public CurrentlyInfo()
{
}
public CurrentlyInfo(string proLotNo)
{
this.ProLotNo = proLotNo;
}
public CurrentlyInfo(string proLotNo,string itemCode)
{
this.ProLotNo = proLotNo;
this.ItemCode = itemCode;
}
#region 打印信息
/// <summary>
/// 批号(除MML类产品,长度为6)
/// </summary>
public virtual string ProLotNo { get; set; }
/// <summary>
/// 产品代码
/// </summary>
public virtual string ItemCode { get; set; }
/// <summary>
/// 批号(原始)
/// </summary>
public virtual string OrgLotNo { get; set; }
#endregion
}
配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Blpsitm" table="Blpsitm">
<id name="ItemCode" type="string" length="7" />
<property name="Registered" type="string" length="50" />
<property name="Licensedid" type="string" length="50" />
<property name="DrugName" type="string" length="50" />
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="CurrentlyInfo" table="CurrentlyInfo">
<id name="ProLotNo" type="string" length="10" />
<property name="OrgLotNo" type="string" length="50"/>
<many-to-one name="ItemCode" class="Blpsitm" column="ItemCode"></many-to-one>
</class>
</hibernate-mapping>
在执行select c.ProLotNo,c.ItemCode,b.DrugName,b.Quantity from CurrentlyInfo c left join Blpsitm b 是出现如下错误:
Path expected for join!
请问各位大虾,是怎么回事?谢谢