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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Ambler, S.W.: Agile Database Techniques. Wiley, Indianapolis (2003)
Cabibbo, L., Carosi, A.: Managing Inheritance Hierarchies in Object/Relational Mapping Tools. In: Pastor, Ó., Falcão e Cunha, J. (eds.) CAiSE 2005. LNCS, vol. 3520, pp. 135–150. Springer, Heidelberg (2005)
Codd, E.F.: A relational model of data for large shared data banks. Communications of the ACM 13(6), 377–387 (1970)
Codd, E.F.: Extending the database relational model to capture more meaning. ACM Trans. Database Syst. 4(4), 397–434 (1979)
Fowler, M.: Patterns of Enterprise Application Architecture. Addison-Wesley, Boston (2003)
Helman, P.: The Science of Database Management. Richard D. Irwin Inc., Burr Ride, IL (1994)
Holder, S., Buchan, J., MacDonell, S.G.: Towards a Metrics Suite for Object-Relational Mappings. In: Kutsche, R.-D., Milanovic, N. (eds.) MBSDI 2008. CCIS, vol. 8, pp. 43–54. Springer, Heidelberg (2008)
Ireland, C., Bowers, D., Newton, M., Waugh, K.: A classification of object-relational impedance mismatch. In: Proceedings of the 2009 First International Conference on Advances in Databases, Knowledge, and Data Applications, pp. 36–43. IEEE Computer Society (2009)
Khoshafian, S., Copeland, G.P.: Object identity. In: OOPSLA 1986, pp. 406–416 (1986)
Kowark, T., Hirschfeld, R., Haupt, M.: Object-relational mapping with SqueakSave. In: Proceedings of the International Workshop on Smalltalk Technologies, IWST 2009, pp. 87–100. ACM (2009)
Link, S., Lukovic, I., Mogin, P.: Performance evaluation of natural and surrogate key database architectures. Tech. rep., Victoria University of Wellington, Wellington, NZ (2010)
Mork, P., Bernstein, P.A., Melnik, S.: Teaching a Schema Translator to Produce O/R Views. In: Parent, C., Schewe, K.-D., Storey, V.C., Thalheim, B. (eds.) ER 2007. LNCS, vol. 4801, pp. 102–119. Springer, Heidelberg (2007)
O’Neil, E.J.: Object/relational mapping 2008: Hibernate and the entity data model (EDM). In: Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, pp. 1351–1356. ACM (2008)
Wieringa, R., de Jonge, W.: Object identifiers, keys, and surrogates– object identifiers revisited. Theory and Practice of Object Systems 1(2), 101–114 (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Olah, M.J., Mohr, D., Stefanovic, D. (2012). Representing Uniqueness Constraints in Object-Relational Mapping. In: Furia, C.A., Nanz, S. (eds) Objects, Models, Components, Patterns. TOOLS 2012. Lecture Notes in Computer Science, vol 7304. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30561-0_17
Download citation
DOI: https://doi.org/10.1007/978-3-642-30561-0_17
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-30560-3
Online ISBN: 978-3-642-30561-0
eBook Packages: Computer ScienceComputer Science (R0)