Cuba Entities in a shared project

Hi

I’m working on a project that consumes the Cuba REST API. To avoid duplicating code, I want to extract the entities of the global project into a shared project. However moving there entities removes them from the cuba studio Data Model tab.

Is there a way to configure where the Data Model retrieves it’s entities?

Kind regard
Benjamin

Hello, @benjamin.barrett.developer!

Did I understand correctly that you want Studio shows entities from application components on the Data Model tab?

Regards,
Daniil.

Hi

I’m not sure what you mean with application components, but generally I want to show Entities from a library project in the Studio.

King regards,
Benjamin

hi

with application components you can exactly do that. Sharing code in general and domain models in particular across different applications.

You can read about it here:

and here’s the example code:

Besides application components you can also just use jar files and dependencies to share regular java code that is independent of CUBA and use it in different CUBA apps (as well as other JVM based apps).

Bye
Mario

1 Like

Hi

Thank you for your reply.

This is exactly what I was looking for.

Kind regards
Benjamin