--- url: "https://martinfowler.com/eaaCatalog/associationTableMapping.html" titulek: "Association Table Mapping" h1: "Association Table Mapping" popis: "Saves an association as a table with foreign keys to the tables that are linked by the association." jazyk: "" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 21:08:48" znaku: 1122 slov: 166 kodovani: "utf-8" sha256: "c07008b79657c8adc4a9619df9271b03636b8d6f3f776125e1f63666a6e05b6d" --- # Association Table Mapping Saves an association as a table with foreign keys to the tables that are linked by the association. Objects can handle multivalued fields quite easily by using collections as field values. Relational databases don't have this feature and are constrained to single-valued fields only. When you're mapping a one-to-many association you can handle this using [Foreign Key Mapping](foreignKeyMapping.html), essentially using a foreign key for the single-valued end of the association. But a many-to-many association can't do this because there is no single-valued end to hold the foreign key. The answer is the classic resolution that's been used by relational data people for decades: create an extra table to record the relationship. Then use Association Table Mapping to map the multivalued field to this link table. for more details go to [Chapter 12](https://learning.oreilly.com/library/view/patterns-of-enterprise/0321127420/ch12.html#ch12lev1sec3) of the online ebook at oreilly.com This pattern is part of [Patterns of Enterprise Application Architecture](.) [Martin Fowler](/) 05 March 2003