Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The goal of this project is to study the JPA relationships: one-to-one, one-to-many / many-to-one, and many-to-many.

NotificationsYou must be signed in to change notification settings

ivangfr/spring-data-jpa-relationships

Repository files navigation

The goal of this project is to study the JPA relationships:one-to-one,one-to-many /many-to-one, andmany-to-many.

Proof-of-Concepts & Articles

Onivangfr.github.io, I have compiled my Proof-of-Concepts (PoCs) and articles. You can easily search for the technology you are interested in by using the filter. Who knows, perhaps I have already implemented a PoC or written an article about what you are looking for.

Additional Readings

Prerequisites

Start Environment

In a terminal and inside thespring-data-jpa-relationships root folder, run the following command:

docker compose up -d

Running application using Maven

In a terminal and inside thespring-data-jpa-relationships root folder, run the command below:

./mvnw clean spring-boot:run

Once the application is running, you can access its Swagger website athttp://localhost:8080/swagger-ui.html.

Useful Commands

  • Postgres
    dockerexec -it postgres psql -U postgres -d jparelationshipsdb\d personsselect* from persons;

    Typeexit to exit

Shutdown

  • To stop the application, go to the terminal where it is running and pressCtrl+C;
  • To stop and remove docker compose containers, network and volumes, go to a terminal and, inside thespring-data-jpa-relationships root folder, run the following command:
    docker compose down -v

Running Tests

In a terminal and inside thespring-data-jpa-relationships root folder, run the following command:

./mvnw cleantest

JPA relationships

One-to-One with Simple Primary Key

teams_team_details

[Medium]:Understanding Relationships in JPA: One-to-One with Simple Primary Key

One-to-One with Shared Primary Key

persons_person_details

[Medium]Understanding Relationships in JPA: One-to-One with Shared Primary Key

One-to-Many with Simple Primary Key

restaurants_dishes

[Medium]Understanding Relationships in JPA: One-to-Many with Simple Primary Key

One-to-Many with Composite Primary Key

players_weapons

[Medium]Understanding Relationships in JPA: One-to-Many with Composite Primary Key

Many-to-Many with Simple Primary Key

writers_books

[Medium]Understanding Relationships in JPA: Many-to-Many with Simple Primary Key

Many-to-Many with Simple Primary Key and Extra Column

reviewers_articles

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

Many-to-Many with Composite Primary Key and Extra Column

students_courses

[Medium]Understanding Relationships in JPA: Many-to-Many with Composite Primary Key and Extra Column

References

One-to-One

One-to-Many / Many-to-One

Many-to-Many

About

The goal of this project is to study the JPA relationships: one-to-one, one-to-many / many-to-one, and many-to-many.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp