Metraipolis › archive › dc_a604e53dc121

Object–relational mapping — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping
License (as archived)
CC-BY-SA-4.0
Archived
2026-10-07T20:11:29.428Z
SHA-256 of the archived text
7735dbfab86645c5f00d77a5daf637cec2e098428d1f6492bdb26db7f61598cb
Stable URL of this page
https://metraipolis.com/documento/dc_a604e53dc121

How to cite

Object–relational mapping — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_a604e53dc121 (Metraipolis archive dc_a604e53dc121, sha256 7735dbfab86645c5f00d77a5daf637cec2e098428d1f6492bdb26db7f61598cb)
BibTeX
@misc{dca604e53dc121,
  title = {Object–relational mapping — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_a604e53dc121; sha256 7735dbfab86645c5f00d77a5daf637cec2e098428d1f6492bdb26db7f61598cb},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Object–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between a relational database and the memory (usually the heap) of an object-oriented programming language. This creates, in effect, a virtual object database that can be used from within the program. In object-oriented programming, data-management tasks act on objects that combine scalar values into objects. For example, consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses. This could be modeled in an object-oriented implementation by a "Person object" with an attribute/field to hold each data item that the entry comprises: the person's name, a list of phone numbers, and a list of addresses. The list of phone numbers would itself contain "PhoneNumber objects" and so on. Each such address-book entry is treated as a single object by the programming language (it can be referenced by a single variable containing a pointer to the object, for instance). Various methods can be associated with the object, such as methods to return the preferred phone number, the home address, and so on. By contrast, relational databases, such as SQL, group scalars into tuples, which are then enumerated in tables. Tuples and objects have some general similarity, in that they are both ways to collect values into named fields such that the whole collection can be manipulated as a single compound entity. They have many differences, though, in particular: lifecycle management (row insertion and deletion, versus garbage collection or reference counting), references to other entities (object references, versus foreign key references), and inheritance (non-existent in relational databases). As well, objects are managed on-heap and are under full control of a single process, while database tuples are shared and must incorporate locking, merging, and retry. Object–relational mapping provides automated support for mapping tuples to objects and back, while accounting for all of these differences. The heart of the problem involves translating the logical representation of the objects into an atomized form that is capable of being stored in the database while preserving the properties of the objects and their relationships so that they can be reloaded as objects when needed. If this storage and retrieval functionality is implemented, the objects are said to be persistent.

Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «database»).
Fonte: Wikipedia in inglese, voce «Object–relational mapping» — https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping
Wikidata Q58748 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q58748
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1340545999, consultata il 2026-10-07T19:26:49.624Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: b5e413ea65eacaabed10010adf93d17ddddd8dd3d15b4c2efd19ba4ded671a4b