目前,我正在使用“many-to-one >中藏书的元件,从数据库中挑选数据标象如下。
<property name="ContactId" length="4" />
<many-to-one
name="DefaultContact"
column="ContactId"
class="Models.Contact"
update="false"
insert="false"/>
这份法典正在妥善收集数据,但现在我需要有条件地收集数据,就像在黑手档案中具有以下特性和单体元素。
<property name="ParentId" length="4" />
<property name="ParentType" length="4" />
<many-to-one
name="ContactParent"
column="???????? ParentId which could be CustomerId or ProspectId or LeadId according to Parent Type ????????"
class="???????? Models.Customer or Models.Prospect or Models.Lead - according to Parent Type ????????"
update="false"
insert="false"/>
And I have to fetch the data according to value in "Parent Type" property, which means I need to set class attribute of "many-to-one" element dynamically according to "Parent Type" property.
因此,现在,我怎么能以许多对一的内容或其他方式取得预期成果?
预付款。