• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » What is Object-Relational Mapping?

By Abhishek Ghosh November 5, 2021 6:25 pm Updated on November 5, 2021

What is Object-Relational Mapping?

Advertisement

Object-relational mapping (ORM) is a software development technique that allows an application program written in an object-oriented programming language to store its objects in a relational database. The database then appears to the program as an object-oriented database, which facilitates programming. This technique is usually implemented with class libraries, such as Entity Framework for .NET programming languages, Hibernate for the Java programming language, Doctrine for PHP, SQL Alchemy for Python, Active Record for Ruby, or Diesel for Rust. For Java, there is also a standardized interface, the Jakarta Persistence API.

Object-oriented programming languages encapsulate data and behaviour in objects, whereas relational databases place data in tables. The two paradigms are fundamentally different. In this way, objects encapsulate their state and behaviour behind an interface and have a unique identity. Relational databases, on the other hand, are based on the mathematical concept of relational algebra. This conceptual contradiction became known in the 1990s as an object-relational impedance mismatch.

To resolve or at least mitigate the contradiction, various solutions have been proposed, such as object-oriented databases or the extension of programming languages with relational concepts (for example, embedded SQL). The direct object-relational mapping of objects to relations has the advantage that on the one hand, the programming language itself does not have to be extended and on the other hand, relational databases are available as established technology in all environments as mature software. The disadvantage of this approach, which is accommodating to the object-oriented programming language paradigm, is that the strengths and capabilities of relational databases are sometimes not used, which can translate into non-optimal performance.

Advertisement

---

In the simplest case, classes are mapped to tables, each object corresponds to a table row, and a table column is reserved for each attribute. The identity of an object corresponds to the primary key of the table. If an object has a reference to another object, it can be represented with a foreign key-primary key relationship in the database. The term shadow information refers to additional data that an object needs to be stored persistently. This includes primary keys – especially if they are surrogate keys of no technical significance – as well as auxiliary data for access control, such as timestamps.

 

Mapping of Inheritance Hierarchies

 

There are essentially three different ways to map inheritance hierarchies to database tables. Some frameworks offer further variations and mixtures of these three basic methods.

Table per inheritance hierarchy: In this procedure, all attributes of the base class and all classes derived from it are stored in a common table. In addition, a so-called “discriminator” is stored in another column, which determines which class the object stored in this row belongs to. In most cases, however, attributes of derived classes may not be provided with a NOT NULL constraint in this approach. In addition, restrictions on the number of allowed columns per table can thwart this approach for large classes or class hierarchies.

What is Object-Relational Mapping

Table per subclass: In this procedure, a table is created for the base class and another table is created for each subclass derived from it. A discriminator is not needed because the class of an object is defined by a 1-to-1 relationship between the entry in the base class table and an entry in one of the tables of the derived classes.
Table per specific class: Here, the attributes of the abstract base class are included in the tables for the concrete subclasses. The table for the base class is omitted. The disadvantage of this approach is that it is not possible to use a query to discover instances of different classes.

Another method is the mapping of structures (relationships, inheritance) and data in general tables. The entire database contains exactly 5 tables: one for classes, one for relationships (including inheritance relationships), one for attributes, one for instances (of the classes), and one for values (of the attributes). However, this procedure has little significance in practice.

This Article Has Been Shared 437 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to What is Object-Relational Mapping?

  • Why Hadoop Distributions Like From Cloudera, Hortonworks Exist?

    If You Are New in Data Science/Big Data, it is Normal to Ask Yourself Why Hadoop Distributions Like From Cloudera, Hortonworks Exist?

  • Install Apache Chukwa on Hadoop Cluster

    Apache Chukwa is a data collection and Analysis Framework. Here Are the Steps to Install Apache Chukwa on Hadoop Cluster.

  • Relationship Between Process Mining and Business Intelligence

    Learn what differentiates Process Mining from Business Intelligence, what problems it can solve and how companies can get started.

  • Machine Learning in Capital Markets : Part VII

    This is the continuation of part VI of Machine Learning in Capital Markets. In the course of this work, a critical examination of the use of various learning methods in the analysis of financial market-specific data showed that machine learning methods are only conditionally suitable for successfully predicting share prices. A look at the results […]

  • What is Information Silo?

    An information silo is a management system incapable of mutual exchange with other similar systems. Information silo is a derogatory expression that can be used to describe a lack of operational reciprocity. Derived variants are silo thinking, silo vision and silo mentality. In an Information Silo, the data is not properly shared. It remains within […]

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "What is Object-Relational Mapping?," in The Customize Windows, November 5, 2021, January 30, 2023, https://thecustomizewindows.com/2021/11/what-is-object-relational-mapping/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT