Representing Uniqueness Constraints in Object-Relational Mapping: The Natural Entity Framework

May 1, 2012ยท
Mark J. Olah
,
David Mohr
,
Darko Stefanovic
ยท 0 min read
Abstract
Object-oriented languages model data as transient objects, while relational databases store data persistently using a relational data model. The process of making objects persistent by storing their state as relational tuples is called object-relational mapping (ORM). This process is nuanced and complex as there are many fundamental differences between the relational model and the object model. In this work we address the difficulties in representing entity identity and uniqueness consistently, efficiently, and succinctly in ORM. We introduce the natural entity framework, which: (1) provides a strong concept of value-based persistent object identity; (2) allows the programmer to simultaneously specify natural and surrogate key constraints consistently in the object and relational representations; (3) provides object constructors and initializers that disambiguate the semantics of persistent object creation and retrieval; and (4) automates the mapping of inheritance hierarchies that respect natural key constraints and allows for efficient polymorphic queries and associations.
Type
Publication
50th International Conference on Objects, Models, Components, Patterns