I have two REST microservices (separate projects) responding by the following entities with JPA mapping (@Entity) and each with their own database.
Product (ID and TITLE) and Category (ID and TITLE)
I found some comments saying that it would be best to replicate the entities in each microservice. I think this is not a good solution for duplicate code.
In this way, how to make the JPA relationship between the two entities (@ManyToMany) each being in a different project? What would this architecture look like? What are the options?