Quering custom data from additionaly linked database

Hi, community.

I have a question regarding how to implement a solution for my task using the CUBA platform and I would appreciate some tips.
I’ve googled for some ready solutions but it seems that it would be better to implement it myself using your platform, I found it very promising and perspective.
I went through your manuals and did some investigations but I still don’t have a final vision of how to do it.

I have a database and I need to create a few reports for it. (I don’t need report addon, I am ok with table view and it’s more preferable).
In general, I have two cases. In the first one, I want to show a browser screen for some entity and be able to drill through it (open another entity browser and apply some filter using data from the current browser).

I’ve added additional data source and mapped entities from there. So for now I have entity browsers but I don’t know how to open another entity view programmatically and how to pass some filter params there.

And the second case is to run some custom SQL queries and show results in a table view.
As for this case, I tried to build a screen with a table view but it seems that the table view requires linking to an existing entity. So I don’t know whether I need to create some virtual entity and map SQL query result on it and then use that one in table view or maybe there is a possibility to use table view with custom columns, then run the plain SQL query and just populate that table view?
According to this thread Datagrid with sqlserver view - CUBA.Platform looks like that I need to play with virtual entities.

Could you please give me some hints on how to implement it better using CUBA?

Have you seen this section in the docs: Opening Screens?

Look at this project: GitHub - aleksey-stukalov/github-statistics: The project demonstrates how to use external objects provided via REST API in a CUBA Application
Here you can see how a load delegate is used to get a list of non-persistent entities. You can map your SQL query results to such entity and return a list of entities from the load delegate.

Regards,
Konstantin

1 Like

Oh, I couldn’t believe I’ve missed that topic from the official documentation.
Those two links are exactly what I was looking for.

Thanks a lot, Konstantin.