Multiple Foreign Keys

Posted by GregHiggins on 22-Mar-2018 13:04

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

Posted by Shelley Chase on 22-Mar-2018 15:31

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

Posted by GregHiggins on 26-Mar-2018 11:37

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?

Posted by Shelley Chase on 26-Mar-2018 12:55

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.

Posted by GregHiggins on 27-Mar-2018 11:10

Thank you

This thread is closed