Extending entity from secondary data source


there are two data stores in my project. A is default Cuba database and B is secondary (only read) datasource.

i have some entities in A

A.entity1 related to B.entity1

what i want to achieve is extend entity B.entity1 by relation to A.entity2 (ONE_TO_ONE).

B.entity1 has integer primaryKey. and i like to have same key as primary key in A.entity2.

Here comes the catch: Is it possible to have ASOCIATION to A.entity2 from A.entity1 by same integer id that holds key to B.entity1 ?

I want this, because i need some possibility of filtering over user generated data related to B.entity1 and since this is not possible since it lays in secondary database. If user for example change relation to B.entity1 in A.entity1 for deifferent record i will also get different relation A.entity1 to A.entity2.

Hi, Igor.

Take a look at Problem using association with an entity from app component - CUBA.Platform because it’s similar to your case.



1 Like