【发布时间】:2011-07-27 11:32:47
【问题描述】:
我有一个应用程序,其中包含许多体育俱乐部,每个俱乐部都有许多联系人。
每个联系人都可以是多种类型中的一种,并且这些类型都有指定的显示顺序。
我想为我的实体关系中的联系人指定此排序顺序,但不知道该怎么做。
为了澄清一点,这里是我的三个(简化的)实体 CFC:
club.cfc
component persistent="true" table="clubs"
{
// identifier
property name="clubid" fieldtype="id" setter="false" generator="identity";
// properties
property name="clubname";
// relationships
property name="contacts" cfc="contact" singularname="contact" fieldtype="one-to-many" fkcolumn="clubid";
}
contact.cfc
component persistent="true" table="contacts"
{
// identifier
property name="contactid" fieldtype="id" setter="false" generator="identity";
// properties
property name="clubid";
property name="name";
//relationships
property name="contacttype" cfc="contacttype" fieldtype="many-to-one" fkcolumn="type";
}
contacttype.cfc
component persistent="true" table="contacttypes"
{
// identifier
property name="type" fieldtype="id" insert="false" update="false";
// properties
property name="typename";
property name="displayorder";
}
所以,总而言之,我想做的是让俱乐部及其联系人根据contacttype中的displayorder值排序。
建议?
【问题讨论】:
-
我想知道您是否可以使用 Sam Farmer 对 this question 的建议...看起来这个问题与您的情况相似。
标签: orm coldfusion