Microservices + JPA Entities

1

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?

    
asked by anonymous 25.05.2016 / 13:31

0 answers