Multiple Foreign Keys - Forum - Kendo UI Builder - Progress Community
 Forum

Multiple Foreign Keys

This question has suggested answer(s)

I have the odd datasource in which some fields in the schema are foreign keys to the same other data source. So if f1 is currently bound to my datasource ds1, what do I have to do to bind f2 to ds1 (or a copy of ds1), so that the selection for f1 and f2 are independent? 

All Replies
  • Hi Greg,

    You would need to have a new service interface definition with the revised annotations. Best practice is to keep the service interface separate from the BE code although for demo purposed the wizard lets you easily annotate the BE code as THE service interface. So my suggestion:

    BE_SI1 = service interface with annotations including f1 index annotations. Code simply calls BE methods

    BE_SI3 = service interface with annotations including f2 index annotation. Code simply calls BE methods

    BE = business entity schema and business logic

    In KUIB these are seen as two separate data sources each with their own currency.

    Thanks

    -Shelley

  • I'm obviously explaining this wrong.

    Consider my patient record: On my patient record are lots of details about me, but there are also several fields devoted to information about my physicians. My record has a Staff Physician and a Primary Care Physician -- these may be the same (but highly unlikely), they are usually different.

    However, the StaffPh and PCPh are both lookups into the Physician Table. Additionally, there are StaffPhPP and PCPPhPP subscribing privileges fields which get set along with other sundry details about these doctors.

    Obviously making the selection on PCPh cannot affect the selection of StaffPh and vice versa.

    I would prefer not to send two copies of the Physicians Table down from the server.

    I'm asking what can I do to avoid that?

  • We have talked about having multiple data sources share the same JSDO data, like buffers for a table. I believe you will have to do a little custom code. I'll ask Edsel to provide some sample code.

  • Thank you