Nhibernate 问题 “path expected for join!”

amaxman 2010-06-03 05:34:48
小弟最近在搞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!
请问各位大虾,是怎么回事?谢谢
...全文
600 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aimyray 2012-06-20
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20090226/16/3e8e77ad-bf1f-4946-8d68-882ec7d6ea2c.html

参考这个解决!!!我也是刚刚解决!!!!
aimyray 2012-06-20
  • 打赏
  • 举报
回复
我也遇到了!怎么解决的啊?!!!
lin184195136 2012-01-05
  • 打赏
  • 举报
回复
遇到相同的问题 了

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧