私は多くの連絡先を持つ多数のスポーツクラブを含むアプリを持っています。ColdFusion ORM:エンティティリレーションの並べ替え順
各接点は、種類のうちの1つにすることができ、これらの指定された表示順序があります。
は、私は私のエンティティ関係の連絡先については、このソート順を指定したいのですが、かなりそれを行う方法を見ることができません。
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:ここでは、物事を少し明確にする
は私の3(簡体字)エンティティフロンあります.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値に従ってソートされた連絡先を持つクラブを取得することです。
提案?あなたはHQLを使用してカスタム検索を行うためにclub.cfcでgetContacts
をオーバーライドする必要がありますように
あなたはその質問があなたに似た状況についてであるように見えます... [この質問](http://stackoverflow.com/q/3945734/8174)のためにサムファーマーズ提案を使用することができる場合、私は思ったんだけど。 –