Spring Boot | Spring Data JPA

Understanding Relationships in JPA: Many-to-Many with Simple Primary Key and Extra Column

Discussing “Many-to-Many with Simple Primary Key and Extra Column” and examining how JPA/Hibernate generates the corresponding tables

Ivan Franchin
5 min readMay 18, 2023

--

Photo by Matthew Guay on Unsplash

As mentioned in the introductory article of this series, I’ve faced difficulties in implementing these relationships correctly in my applications.

To enhance my understanding of them, I developed a GitHub repository called ivangfr/spring-data-jpa-relationships, containing simple examples for each relationship type.

In this series of articles, we will demonstrate each JPA relationship type by presenting the necessary code to map the entities and examining how JPA/Hibernate generates tables.

I hope you find these articles and the GitHub repository helpful.

Today, we will talk about “Many-to-Many with Simple Primary Key and Extra Column”. So…

--

--

Ivan Franchin

Lead Software Developer with BS and MS in Computer Science. Writing about Java, Spring, software development in general, and emerging technologies.