각기 많은 연락처가있는 다수의 스포츠 클럽이 포함 된 앱이 있습니다.ColdFusion ORM : 엔티티 관계의 정렬 순서
각 연락처는 여러 유형 중 하나 일 수 있으며 지정된 연락처 순서가 있습니다.
내 엔티티 관계에있는 연락처에 대해이 정렬 순서를 지정하려고하지만이를 수행하는 방법을 알 수 없습니다.
여기, 것들을 조금 명확히 내 세 (간체) 엔티티 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의 제안 (http://stackoverflow.com/q/3945734/8174)을 사용할 수 있는지 궁금합니다. 그 질문은 귀하와 유사한 상황 인 것 같습니다. –