nhibernate配置问题
配置文件:TbAgent
<class name="sms.Model.TbAgent,sms.Model" table="Agent" lazy="true">
<id name="Id" column="Id" type="Int32" unsaved-value="0">
<generator class="native"/> </id>
<property column="AgentId" type="Int32" name="AgentId" not-null="true" />
<property column="AgentName" type="String" name="AgentName" not-null="true" length="1024" />
<property column="MobilePhone" type="String" name="MobilePhone" not-null="true" length="1024" />
<bag name="TbSend" inverse="true" lazy="true">
<key column="RecPhone" not-null="true" />
<one-to-many class="sms.Model.TbSend,sms.Model" not-found="ignore"/>
</bag>
</class>
TbSend
<class name="sms.Model.TbSend,sms.Model" table="Tb_Send" lazy="false">
<id name="Id" column="Id" type="Int64" unsaved-value="0"> </id>
<property column="RecPhone" type="String" name="RecPhone" not-null="true" length="1073741823" />
<property column="SendTime" type="DateTime" name="SendTime" not-null="true" />
<many-to-one name="TbAgent" class="sms.Model.TbAgent,sms.Model">
<column name="MobilePhone"/>
</many-to-one>
</class>
2个表是一对多的关系(TbAgent是父)关系设置成 tbsend.recphone = tbagent.mobilephone
写的HQL:select a from TbAgent a inner join a.TbSend b
跟踪到的时tbsend.recphone = tbagent.id,不知道为什么?
谁能给我解释一下啊!
我的原帖:http://topic.csdn.net/u/20111224/11/7a27b9d7-4337-4b9d-9c9b-a654e31454cc.html