iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.37k stars 26.22k forks source link

Foreign Key Mapping pattern #1296

Open iluwatar opened 4 years ago

iluwatar commented 4 years ago

Description: The Foreign Key Mapping design pattern is used to maintain relationships between tables in a relational database by using foreign keys. This pattern helps in establishing and enforcing referential integrity between related entities. The implementation of this pattern typically involves:

  1. Adding foreign key columns in the child table that reference primary keys in the parent table.
  2. Ensuring the foreign key constraints are properly defined and maintained.
  3. Managing the relationships and ensuring the consistency of data through CRUD operations.

This pattern is essential for ensuring data integrity and facilitating efficient data retrieval in relational database systems.

References:

Acceptance Criteria:

  1. A new implementation of the Foreign Key Mapping pattern is added to the project, including appropriate classes and database schema.
  2. Unit tests are written to cover all CRUD operations, ensuring that referential integrity is maintained.
  3. Documentation is updated to explain the Foreign Key Mapping pattern, including code examples and usage guidelines.
lanxiang1234 commented 3 years ago

I would like to work on it

ohbus commented 3 years ago

Happy to have you here @lanxiang1234

Please mention a timeline for when can we expect a PR against this issue.

zswl110 commented 1 year ago

I would like to work on it

iluwatar commented 1 year ago

Yes, go ahead @zswl110

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.