使用ColdFusion Form时如何获取联接表属性?

使用ColdFusion Form时如何获取联接表属性?,orm,coldfusion,coldfusion-10,Orm,Coldfusion,Coldfusion 10,我有两个目标,人和家庭。我使用一个名为“join\u person\u family”的联接表来跟踪这种多对多关系。联接表有另一个名为“IS_PRIMARY”的属性,我想在使用EntityLoadByExample()实例化person对象时获取并筛选该属性,但我不知道如何使用CF ORM实现这一点。我可以通过SQL轻松做到这一点,但我正在尽可能多地使用ORM。也许还有另一种方法可以追踪这片土地,但我想不出任何办法。提前感谢您的帮助 这是家庭。cfc: <cfcomponent hint=

我有两个目标,人和家庭。我使用一个名为“join\u person\u family”的联接表来跟踪这种多对多关系。联接表有另一个名为“IS_PRIMARY”的属性,我想在使用EntityLoadByExample()实例化person对象时获取并筛选该属性,但我不知道如何使用CF ORM实现这一点。我可以通过SQL轻松做到这一点,但我正在尽可能多地使用ORM。也许还有另一种方法可以追踪这片土地,但我想不出任何办法。提前感谢您的帮助

这是家庭。cfc:

<cfcomponent hint="I am a Family" output="false" persistent="true" extends="_Proxy">
<cfproperty name="FAMILY_ID" hint="FAMILY_ID" type="numeric" ormtype="int" length="11" fieldtype="id" generator="identity" required="true"/>
<cfproperty name="PERSON" hint="PERSON" fieldtype="many-to-many" cfc="person" linktable="join_family_person" FKColumn="FAMILY_ID" inversejoincolumn="PERSON_ID" lazy="true"/>
<cfproperty name="STATUS" type="string" ormtype="string" length="45"/>
<cfproperty name="COMMENT" hint="COMMENT" type="string" length="255"/>
<cffunction name="init" hint="constructor" access="public" returntype="family" output="false">
    <cfscript>
return this;
</cfscript>
</cffunction>
</cfcomponent>

归还这个;
这是个人。cfc:

<cfcomponent hint="I am a Person" output="false" persistent="true" extends="_Proxy">
<cfproperty name="FAMILY" hint="FAMILY" fieldtype="many-to-many" cfc="family" linktable="join_family_person" FKColumn="PERSON_ID" inversejoincolumn="FAMILY_ID" lazy="true"/>
<cfproperty name="PERSON_ID" hint="PERSON_ID" type="numeric" ormtype="int" length="11" fieldtype="id" generator="identity" required="true"/>
<cfproperty name="USER" hint="USER" fieldtype="one-to-one" cfc="mend_user" FKColumn="USER_ID" lazy="true"/>
<cfproperty name="FIRST_NAME" hint="FIRST_NAME" type="string" length="45"/>
<cfproperty name="LAST_NAME" hint="LAST_NAME" type="string" length="45"/>
<cfproperty name="STATUS" hint="STATUS" type="numeric" ormtype="int"/>
<cffunction name="init" hint="constructor" access="public" returntype="person" output="false">
    <cfscript>
    return this;
    </cfscript>
</cffunction>

归还这个;
找到此响应。读过这篇文章后,我认为这种方法实际上是优越的

一个与连接对象具有多对一关系的中间实体将允许我使用EntityLoadByExample()获得通过“IS_PRIMARY”过滤的相关person对象。然后,如果需要,我可以过滤person对象。

我找到了这个,但我确实希望有另一种方法。