--- url: "https://martinfowler.com/eaaCatalog/foreignKeyMapping.html" titulek: "Foreign Key Mapping" h1: "Foreign Key Mapping" popis: "Maps an association between objects to a foreign key reference between tables." jazyk: "" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 21:08:47" znaku: 1045 slov: 159 kodovani: "utf-8" sha256: "273ad92d1f4ede8f06905f4a5a54c2459d7a3f7551fb685a57a593575c32c8df" --- # Foreign Key Mapping Maps an association between objects to a foreign key reference between tables. Objects can refer to each other directly by object references. Even the simplest object-oriented system will contain a bevy of objects connected to each other in all sorts of interesting ways. To save these objects to a database, it's vital to save these references. However, since the data in them is specific to the specific instance of the running program, you can't just save raw data values. Further complicating things is the fact that objects can easily hold collections of refer-ences to other objects. Such a structure violates the first normal form of rela-tional databases. A Foreign Key Mapping maps an object reference to a foreign key in the database. for more details go to [Chapter 12](https://learning.oreilly.com/library/view/patterns-of-enterprise/0321127420/ch12.html#ch12lev1sec2) of the online ebook at oreilly.com This pattern is part of [Patterns of Enterprise Application Architecture](.) [Martin Fowler](/) 05 March 2003