{"id":4429,"date":"2024-11-05T12:46:00","date_gmt":"2024-11-05T11:46:00","guid":{"rendered":"https:\/\/rock-the-prototype.com\/uncategorized\/object-relational-mapping\/"},"modified":"2023-12-13T08:25:28","modified_gmt":"2023-12-13T07:25:28","slug":"object-relational-mapping","status":"publish","type":"encyclopedia","link":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/","title":{"rendered":"Object Relational Mapping"},"content":{"rendered":"<p><\/p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\"><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1144px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Inhaltsverzeichnis<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#1_What_is_Object_Relational_Mapping\" >1 What is Object Relational Mapping?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#2_How_does_Object_Relational_Mapping_work\" >2 How does Object Relational Mapping work?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#21_Basic_principle_of_ORM\" >2.1 Basic principle of ORM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#22_Functionality\" >2.2 Functionality<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#23_An_illustrative_ORM_example\" >2.3 An illustrative ORM example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#3_why_use_ORM\" >3. why use ORM?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#Detailed_mode_of_operation\" >Detailed mode of operation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#Application_example\" >Application example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#4_known_ORM_frameworks\" >4. known ORM frameworks<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#41_Hibernate_Java\" >4.1 Hibernate (Java)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#42_Django_ORM_Python\" >4.2 Django ORM (Python)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#43_Entity_Framework_C\" >4.3 Entity Framework (C#)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#5_Advantages_and_disadvantages_of_ORM\" >5 Advantages and disadvantages of ORM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#6_best_practices_in_the_use_of_ORM\" >6. best practices in the use of ORM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#7_summary\" >7. summary<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#Application_example-2\" >Application example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#4_known_ORM_frameworks-2\" >4. known ORM frameworks<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#41_Hibernate_Java-2\" >4.1 Hibernate (Java)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#42_Django_ORM_Python-2\" >4.2 Django ORM (Python)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#43_Entity_Framework_C-2\" >4.3 Entity Framework (C#)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#5_Advantages_and_disadvantages_of_ORM-2\" >5 Advantages and disadvantages of ORM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#6_best_practices_in_the_use_of_ORM-2\" >6. best practices in the use of ORM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#7_summary-2\" >7. summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_What_is_Object_Relational_Mapping\"><\/span>1 What is Object Relational Mapping?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong><a href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/\" target=\"_blank\" title=\"Object Relational Mapping (ORM) - A paradigm shift in database interaction! Discover how ORM bridges the gap between object-oriented programming and relational databases to optimize development processes and make code cleaner and more maintainable.\" class=\"encyclopedia\">Object Relational Mapping<\/a><\/strong> (ORM) is a <a href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/programming\/\" target=\"_blank\" title=\"What is programming? When programming, a programmer creates a software program that can run on a machine. The code is created in one of the formally defined computer languages - which are countless, such as Java, PHP, C++ or C#, Perl and many many more.\" class=\"encyclopedia\">programming<\/a> paradigm that bridges the gap between <a href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-oriented-programming\/\" target=\"_blank\" title=\"What is object-oriented programming? Object-oriented programming is a software architecture concept that provides a successful model for abstracting real-world conditions in software applications.\" class=\"encyclopedia\">object-oriented programming<\/a> languages and relational databases. It <strong>transforms data<\/strong> between <strong>compatible systems<\/strong>, allowing developers to handle database transactions using object-oriented techniques.<\/p>\n\n<h2><span class=\"ez-toc-section\" id=\"2_How_does_Object_Relational_Mapping_work\"><\/span>2 How does Object Relational Mapping work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"21_Basic_principle_of_ORM\"><\/span><strong>2.1 Basic principle of ORM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Object Relational Mapping (ORM) is basically a technique that makes it possible to manipulate data between a relational database and an object-oriented programming system. The database tables are represented as classes, while the rows in these tables are represented as instances of the respective class and the columns as properties (attributes) of these instances.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"22_Functionality\"><\/span><strong>2.2 Functionality<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li><strong>Object entity<\/strong>: With ORM, each object is assigned directly to a database entity (in most cases a table).<\/li>\n<li><strong>Database abstraction<\/strong>: ORM systems offer a level of abstraction via SQL. Instead of writing SQL statements, you execute CRUD operations (Create, Read, Update, Delete) using object-oriented techniques.<\/li>\n<li><strong>Synchronization<\/strong>: ORM systems automatically synchronize the database status with the current status of the object in the application and vice versa.<\/li>\n<li><strong>Queries<\/strong>: With ORM, you can execute complex queries using your usual programming language without writing direct SQL code.<\/li>\n<\/ol>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Podcast Software Development - Idea generation and creativity in software development\" href=\"#\"><iframe class=\"lazyload\" style=\"border-radius: 12px;\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27100%27%20height%3D%27352%27%20viewBox%3D%270%200%20100%20352%27%3E%3Crect%20width%3D%27100%27%20height%3D%27352%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/open.spotify.com\/embed\/episode\/54PtfzZlt3gTfrxDcx4wrC?utm_source=generator\" width=\"100%\" height=\"352\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/a>\n<div class=\"fusion-text fusion-text-2\"><h3><span class=\"ez-toc-section\" id=\"23_An_illustrative_ORM_example\"><\/span><strong>2.3 An illustrative ORM example<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let&rsquo;s look at a simple example: a book system with a database that stores books and authors.<\/p>\n<p>In a relational database, we might have two tables: <code>B\u00fccher<\/code> and <code>Autoren<\/code>.<\/p>\n<ul>\n<li><code>B\u00fccher<\/code>-Table:\n<ul>\n<li>BookID (primary key)<\/li>\n<li>Book name<\/li>\n<li>AuthorID (foreign key)<\/li>\n<\/ul>\n<\/li>\n<li><code>Autoren<\/code>-Table:\n<ul>\n<li>AuthorID (primary key)<\/li>\n<li>AuthorName<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>With an ORM system, we could have two classes in our application, <code>Buch<\/code> and <code>Autor<\/code>.<\/p>\n<div id=\"attachment_3955\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-3955\" class=\"size-full wp-image-3954\" src=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling.jpg\" alt=\"Object Relational Mapping - ORM code - Smart Database Handling\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-66x66.jpg 66w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-150x150.jpg 150w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-200x200.jpg 200w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-300x300.jpg 300w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-400x400.jpg 400w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-600x600.jpg 600w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-768x768.jpg 768w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling-800x800.jpg 800w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM-Code-Database-Handling.jpg 1024w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><p id=\"caption-attachment-3955\" class=\"wp-caption-text\">Object Relational Mapping &ndash; ORM code &ndash; Smart Database Handling<\/p><\/div>\n<p>In an object-oriented programming language, this could look like this:<\/p>\n<p><em>class Author:<\/em><br>\n<em>def __init__(self, id, name):<\/em><br>\n<em>self.id = id<\/em><br>\n<em>self.name = name<\/em><\/p>\n<p><em>class book:<\/em><br>\n<em>def __init__(self, id, name, author):<\/em><br>\n<em>self.id = id<\/em><br>\n<em>self.name = name<\/em><br>\n<em>self.author = author # This represents a relationship to an author object<\/em><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_why_use_ORM\"><\/span><strong>3. why use ORM?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Object Relational Mapping, often simply referred to as ORM, serves as a bridge between the object-oriented world of application programming and the relational world of databases. This is a technique that allows database operations to be represented in the form of objects and methods instead of using direct SQL code.<\/p>\n<ul>\n<li><strong>Efficiency<\/strong>: It simplifies database access for developers.<\/li>\n<li><strong>Maintainability<\/strong>: The code becomes clearer and easier to maintain.<\/li>\n<li><strong>Database independence<\/strong>: The same ORM code can work with different databases.<\/li>\n<\/ul>\n<div id=\"attachment_3957\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-3957\" class=\"size-full wp-image-3956\" src=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR.jpg\" alt=\"Why ORM? Advantages of Object Relational Mapping\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-66x66.jpg 66w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-150x150.jpg 150w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-200x200.jpg 200w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-300x300.jpg 300w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-400x400.jpg 400w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-600x600.jpg 600w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-768x768.jpg 768w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR-800x800.jpg 800w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Warum-OMR.jpg 1024w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><p id=\"caption-attachment-3957\" class=\"wp-caption-text\">Why ORM? Advantages of Object Relational Mapping<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Detailed_mode_of_operation\"><\/span><strong>Detailed mode of operation<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li><strong>Object-entity mapping<\/strong>: When using ORM, each entity in the database &ndash; usually a table &ndash; corresponds to a class in the application. Each row within this table corresponds to an instance of this class, and each column corresponds to an attribute of this instance.<\/li>\n<li><strong>Database abstraction<\/strong>: ORM enables abstraction from the underlying database and the SQL used. Instead of writing SQL queries directly, operations are performed on the objects and the ORM system takes care of converting these operations into SQL commands.<\/li>\n<li><strong>Automatic synchronization<\/strong>: ORM systems track the status of objects. Changes to an object are recognized and can be automatically transferred to the database.<\/li>\n<li><strong>Linguistic consistency<\/strong>: Queries are written in the same programming language as the rest of the application. The need to constantly switch between SQL and the main programming language is eliminated.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Application_example\"><\/span><strong>Application example<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let&rsquo;s assume we have a web application for managing books in a <a href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/library\/\" target=\"_blank\" title=\"A library refers to a software library as a ready-made collection of code that can be used to perform general software development tasks. Libraries are essentially a collection of functions and procedures that can be called up by other software programs to execute certain functions.\" class=\"encyclopedia\">library<\/a>. In a relational database, we have the tables <code>B\u00fccher<\/code> and <code>Autoren<\/code>.<\/p>\n<p>With an ORM tool, we could create a corresponding class in our application for each of these tables. When a new book is added to the library, we would simply create a new book object and save it. The ORM tool then takes care of converting this book object into a new data record in the <code>B\u00fccher<\/code> table.<\/p>\n<p>Example in <a href=\"https:\/\/rock-the-prototype.com\/en\/programming-languages-frameworks\/python\/\" target=\"_blank\" title=\"Python is an object-oriented programming language. Python is currently one of the most widely used programming languages. Why you should program in Python...\" class=\"encyclopedia\">Python<\/a> with the ORM tool SQLAlchemy:<\/p>\n<p><em>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey<\/em><br>\n<em>from sqlalchemy.orm import sessionmaker, relationship<\/em><br>\n<em>from sqlalchemy.ext.declarative import declarative_base<\/em><\/p>\n<p><em>Base = declarative_base()<\/em><\/p>\n<p><em>class Author(Base):<\/em><br>\n<em>__tablename__ = &lsquo;authors&rsquo;<\/em><\/p>\n<p><em>id = Column(Integer, primary_key=True)<\/em><br>\n<em>name = Column(String)<\/em><\/p>\n<p><em>books = relationship(&ldquo;book&rdquo;, back_populates=&rdquo;author&rdquo;)<\/em><\/p>\n<p><em>class Book(Base):<\/em><br>\n<em>__tablename__ = &lsquo;books&rsquo;<\/em><\/p>\n<p><em>id = Column(Integer, primary_key=True)<\/em><br>\n<em>title = Column(String)<\/em><br>\n<em>author_id = Column(Integer, ForeignKey(&lsquo;authors.id&rsquo;))<\/em><\/p>\n<p><em>author = relationship(&ldquo;Author&rdquo;, back_populates=&rdquo;books&rdquo;)<\/em><\/p>\n<p><em># Create database and set up session<\/em><br>\n<em>engine = create_engine(&lsquo;sqlite:\/\/\/library.db&rsquo;)<\/em><br>\n<em>Base.metadata.create_all(engine)<\/em><\/p>\n<p><em>Session = sessionmaker(bind=engine)<\/em><br>\n<em>session = Session()<\/em><\/p>\n<p><em># Add new author and book<\/em><br>\n<em>jk_rowling = Author(name=&rdquo;J.K. Rowling&rdquo;)<\/em><br>\n<em>session.add(jk_rowling)<\/em><\/p>\n<p><em>harry_potter = book(title=&rdquo;Harry Potter and the Philosopher&rsquo;s Stone&rdquo;, author=jk_rowling)<\/em><br>\n<em>session.add(harry_potter)<\/em><\/p>\n<p><em>session.commit()<\/em><\/p>\n<p>In this example, we have two classes, <code>Autor<\/code> and <code>Buch<\/code>, and use them to store information in the database without writing direct SQL code. ORM thus enables an intuitive and object-oriented approach to database interaction that offers several advantages:<\/p>\n<ol>\n<li><strong>Seamless integration<\/strong>: By working with classes and objects that correspond directly to tables in the database, developers can design their application logic in a way that is more natural and consistent with the rest of their application.<\/li>\n<li><strong>Increased productivity<\/strong>: Developers no longer have to spend time writing and optimizing complex SQL queries. Instead, they can concentrate on the business logic and take advantage of the benefits of object-oriented programming.<\/li>\n<li><strong>Error prevention<\/strong>: Since ORM tools often ensure that the queries created are correct, this reduces the risk of database errors that could result from improperly written SQL.<\/li>\n<li><strong>Flexibility<\/strong>: If required, developers can still work directly at SQL level. This means that they are not completely restricted and can make specific adjustments or optimizations if the situation requires it.<\/li>\n<li><strong>Consistency<\/strong>: By using an ORM system, developers can ensure that database operations are performed in a uniform and consistent manner throughout the project. This also facilitates collaboration in larger teams, as everyone uses the same ORM methodology.<\/li>\n<\/ol>\n<p>Implementing ORM in projects therefore not only simplifies database interaction, but also improves code quality and maintainability, while at the same time reducing development time. It is an approach that is well suited to both small and large projects and offers developers considerable advantages in terms of efficiency and flexibility.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_known_ORM_frameworks\"><\/span><strong>4. known ORM frameworks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"41_Hibernate_Java\"><\/span>4.1 <strong>Hibernate (Java)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>One of the best-known ORM frameworks, offers a flexible and powerful abstraction for <a href=\"https:\/\/rock-the-prototype.com\/en\/programming-languages-frameworks\/java\/\" target=\"_blank\" title=\"What is Java suitable for in programming? Java is very popular as the official language for developing Android apps. It is a general purpose programming language. This programming language is supported by Google and a large active community of developers.\" class=\"encyclopedia\">Java<\/a> applications.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"42_Django_ORM_Python\"><\/span>4.2 <strong>Django ORM (Python)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>An integral part of the Django web <a href=\"https:\/\/rock-the-prototype.com\/en\/programming-languages-frameworks\/framework\/\" target=\"_blank\" title=\"A framework is a set of guidelines or rules that provides a structure for the organization and development of code in a particular programming language or platform. The framework serves as a basis or blueprint on which to build when developing software applications.\" class=\"encyclopedia\">framework<\/a>, it allows developers to define data models as Python classes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"43_Entity_Framework_C\"><\/span>4.3 <strong>Entity Framework (C#)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>An ORM for .NET applications that offers closer integration with Microsoft products.<\/p>\n<div id=\"attachment_3959\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-3959\" class=\"size-full wp-image-3958\" src=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank.jpg\" alt=\"ORM architecture - connection between object-oriented application and relational database\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-66x66.jpg 66w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-150x150.jpg 150w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-200x200.jpg 200w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-300x300.jpg 300w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-400x400.jpg 400w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-600x600.jpg 600w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-768x768.jpg 768w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-800x800.jpg 800w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank.jpg 1024w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><p id=\"caption-attachment-3959\" class=\"wp-caption-text\">ORM architecture &ndash; connection between object-oriented application and relational database<\/p><\/div>\n<h2><span class=\"ez-toc-section\" id=\"5_Advantages_and_disadvantages_of_ORM\"><\/span><strong>5 Advantages and disadvantages of ORM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>5.1 <strong>Advantages<\/strong><\/p>\n<ul>\n<li><strong>Productivity increase<\/strong>: Reduction of boilerplate code.<\/li>\n<li><strong>Maintainability<\/strong>: A more consistent code base.<\/li>\n<li><strong>Security<\/strong>: Avoidance of SQL injection through parameterization.<\/li>\n<\/ul>\n<p>5.2 <strong>Disadvantages<\/strong><\/p>\n<ul>\n<li><strong>Performance<\/strong>: ORM can be slower than raw SQL in some cases.<\/li>\n<li><strong>Complexity<\/strong>: Some frameworks have a steep learning curve.<\/li>\n<li><strong>Abstraction<\/strong>: Excessive abstraction can lead to a lack of understanding of the underlying database operations.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"6_best_practices_in_the_use_of_ORM\"><\/span><strong>6. best practices in the use of ORM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>5.1 <strong>Lazy loading<\/strong>: Loading data only when it is needed.<\/p>\n<p>5.2 <strong>Caching<\/strong>: Use of cache mechanisms to minimize repeated database accesses.<\/p>\n<p>5.3 <strong>Optimized SQL code<\/strong>: Even if ORM simplifies the handling of SQL, it is important to monitor and optimize the generated SQL code.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"7_summary\"><\/span><strong>7. summary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Object Relational Mapping is a powerful tool that allows developers to focus on the business logic and worry less about the database layer. However, it is important to understand the benefits and limitations of ORM and follow best practices to achieve the best results.<\/p>\n<\/div><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Podcast Episode 1 - Idea generation and creativity in software development - Rock the Prototype - Software Development\" href=\"#\"><iframe style=\"width: 100%; max-width: 660px; overflow: hidden; border-radius: 10px;\" src=\"https:\/\/embed.podcasts.apple.com\/us\/podcast\/episode-1-idea-generation-and-creativity-in-software\/id1684835330?i=1000611051749\" height=\"175\" frameborder=\"0\" sandbox=\"allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation\"><\/iframe><\/a>\n<div class=\"fusion-text fusion-text-3\"><h3><span class=\"ez-toc-section\" id=\"Application_example-2\"><\/span><strong>Application example<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let&rsquo;s assume we have a web application for managing books in a library. In a relational database, we have the tables <code>B\u00fccher<\/code> and <code>Autoren<\/code>.<\/p>\n<p>With an ORM tool, we could create a corresponding class in our application for each of these tables. When a new book is added to the library, we would simply create a new book object and save it. The ORM tool then takes care of converting this book object into a new data record in the <code>B\u00fccher<\/code> table.<\/p>\n<p>Example in Python with the ORM tool SQLAlchemy:<\/p>\n<p><em>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey<\/em><br>\n<em>from sqlalchemy.orm import sessionmaker, relationship<\/em><br>\n<em>from sqlalchemy.ext.declarative import declarative_base<\/em><\/p>\n<p><em>Base = declarative_base()<\/em><\/p>\n<p><em>class Author(Base):<\/em><br>\n<em>__tablename__ = &lsquo;authors&rsquo;<\/em><\/p>\n<p><em>id = Column(Integer, primary_key=True)<\/em><br>\n<em>name = Column(String)<\/em><\/p>\n<p><em>books = relationship(&ldquo;book&rdquo;, back_populates=&rdquo;author&rdquo;)<\/em><\/p>\n<p><em>class Book(Base):<\/em><br>\n<em>__tablename__ = &lsquo;books&rsquo;<\/em><\/p>\n<p><em>id = Column(Integer, primary_key=True)<\/em><br>\n<em>title = Column(String)<\/em><br>\n<em>author_id = Column(Integer, ForeignKey(&lsquo;authors.id&rsquo;))<\/em><\/p>\n<p><em>author = relationship(&ldquo;Author&rdquo;, back_populates=&rdquo;books&rdquo;)<\/em><\/p>\n<p><em># Create database and set up session<\/em><br>\n<em>engine = create_engine(&lsquo;sqlite:\/\/\/library.db&rsquo;)<\/em><br>\n<em>Base.metadata.create_all(engine)<\/em><\/p>\n<p><em>Session = sessionmaker(bind=engine)<\/em><br>\n<em>session = Session()<\/em><\/p>\n<p><em># Add new author and book<\/em><br>\n<em>jk_rowling = Author(name=&rdquo;J.K. Rowling&rdquo;)<\/em><br>\n<em>session.add(jk_rowling)<\/em><\/p>\n<p><em>harry_potter = book(title=&rdquo;Harry Potter and the Philosopher&rsquo;s Stone&rdquo;, author=jk_rowling)<\/em><br>\n<em>session.add(harry_potter)<\/em><\/p>\n<p><em>session.commit()<\/em><\/p>\n<p>In this example, we have two classes, <code>Autor<\/code> and <code>Buch<\/code>, and use them to store information in the database without writing direct SQL code. ORM thus enables an intuitive and object-oriented approach to database interaction that offers several advantages:<\/p>\n<ol>\n<li><strong>Seamless integration<\/strong>: By working with classes and objects that correspond directly to tables in the database, developers can design their application logic in a way that is more natural and consistent with the rest of their application.<\/li>\n<li><strong>Increased productivity<\/strong>: Developers no longer have to spend time writing and optimizing complex SQL queries. Instead, they can concentrate on the business logic and take advantage of the benefits of object-oriented programming.<\/li>\n<li><strong>Error prevention<\/strong>: Since ORM tools often ensure that the queries created are correct, this reduces the risk of database errors that could result from improperly written SQL.<\/li>\n<li><strong>Flexibility<\/strong>: If required, developers can still work directly at SQL level. This means that they are not completely restricted and can make specific adjustments or optimizations if the situation requires it.<\/li>\n<li><strong>Consistency<\/strong>: By using an ORM system, developers can ensure that database operations are performed in a uniform and consistent manner throughout the project. This also facilitates collaboration in larger teams, as everyone uses the same ORM methodology.<\/li>\n<\/ol>\n<p>Implementing ORM in projects therefore not only simplifies database interaction, but also improves code quality and maintainability, while at the same time reducing development time. It is an approach that is well suited to both small and large projects and offers developers considerable advantages in terms of efficiency and flexibility.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_known_ORM_frameworks-2\"><\/span><strong>4. known ORM frameworks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"41_Hibernate_Java-2\"><\/span>4.1 <strong>Hibernate (Java)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>One of the best-known ORM frameworks, offers a flexible and powerful abstraction for Java applications.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"42_Django_ORM_Python-2\"><\/span>4.2 <strong>Django ORM (Python)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>An integral part of the Django web framework, it allows developers to define data models as Python classes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"43_Entity_Framework_C-2\"><\/span>4.3 <strong>Entity Framework (C#)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>An ORM for .NET applications that offers closer integration with Microsoft products.<\/p>\n<div id=\"attachment_3959-2\" style=\"width: 1034px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-3959-2\" class=\"size-full wp-image-3958\" src=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank.jpg\" alt=\"ORM architecture - connection between object-oriented application and relational database\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-66x66.jpg 66w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-150x150.jpg 150w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-200x200.jpg 200w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-300x300.jpg 300w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-400x400.jpg 400w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-600x600.jpg 600w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-768x768.jpg 768w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank-800x800.jpg 800w, https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/ORM-Architektur-Verbindung-zwischen-objektorientierter-Anwendung-und-relationaler-Datenbank.jpg 1024w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><p id=\"caption-attachment-3959-2\" class=\"wp-caption-text\">ORM architecture &ndash; connection between object-oriented application and relational database<\/p><\/div>\n<h2><span class=\"ez-toc-section\" id=\"5_Advantages_and_disadvantages_of_ORM-2\"><\/span><strong>5 Advantages and disadvantages of ORM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>5.1 <strong>Advantages<\/strong><\/p>\n<ul>\n<li><strong>Productivity increase<\/strong>: Reduction of boilerplate code.<\/li>\n<li><strong>Maintainability<\/strong>: A more consistent code base.<\/li>\n<li><strong>Security<\/strong>: Avoidance of SQL injection through parameterization.<\/li>\n<\/ul>\n<p>5.2 <strong>Disadvantages<\/strong><\/p>\n<ul>\n<li><strong>Performance<\/strong>: ORM can be slower than raw SQL in some cases.<\/li>\n<li><strong>Complexity<\/strong>: Some frameworks have a steep learning curve.<\/li>\n<li><strong>Abstraction<\/strong>: Excessive abstraction can lead to a lack of understanding of the underlying database operations.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"6_best_practices_in_the_use_of_ORM-2\"><\/span><strong>6. best practices in the use of ORM<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>5.1 <strong>Lazy loading<\/strong>: Loading data only when it is needed.<\/p>\n<p>5.2 <strong>Caching<\/strong>: Use of cache mechanisms to minimize repeated database accesses.<\/p>\n<p>5.3 <strong>Optimized SQL code<\/strong>: Even if ORM simplifies the handling of SQL, it is important to monitor and optimize the generated SQL code.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"7_summary-2\"><\/span><strong>7. summary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Object Relational Mapping is a powerful tool that allows developers to focus on the business logic and worry less about the database layer. However, it is important to understand the benefits and limitations of ORM and follow best practices to achieve the best results.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\"><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1144px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><a class=\"fusion-modal-text-link\" data-toggle=\"modal\" data-target=\".fusion-modal.Rock the Prototype - Softwareentwicklung &amp; Prototyping Podcast iTunes\" href=\"#\"><iframe id=\"embedPlayer\" style=\"width: 100%; max-width: 990px; overflow: hidden; border-radius: 10px; transform: translateZ(0px); animation: 2s ease 0s 6 normal none running loading-indicator; background-color: #e4e4e4;\" src=\"https:\/\/embed.podcasts.apple.com\/de\/podcast\/rock-the-prototype-softwareentwicklung-prototyping\/id1684107786?itsct=podcast_box_player&amp;itscg=30200&amp;ls=1&amp;theme=dark\" height=\"450px\" frameborder=\"0\" sandbox=\"allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation-by-user-activation\"><\/iframe> <\/a><\/div><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Object Relational Mapping (ORM) &#8211; A paradigm shift in database interaction! Discover how ORM bridges the gap between object-oriented programming and relational databases to optimize development processes and make code cleaner and more maintainable.<\/p>\n","protected":false},"author":1,"featured_media":3953,"template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[1258,1166,1141],"tags":[1938,1936,1933,1935,1178,1176,1937,1932,1934],"class_list":["post-4429","encyclopedia","type-encyclopedia","status-publish","has-post-thumbnail","hentry","category-learn-programming","category-software-architecture","category-software-development","tag-caching-en","tag-data-models","tag-database-abstraction","tag-database-tables","tag-framework-en","tag-frameworks-en","tag-lazy-loading-en","tag-object-oriented-programming","tag-sql-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Object Relational Mapping - Revolutionize database interaction!<\/title>\n<meta name=\"description\" content=\"Object Relational Mapping (ORM) revolutionizes data access \u2705 Improve maintainability \u2705 Database independence \u2705 Find out more now...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Object Relational Mapping - Revolutionize database interaction!\" \/>\n<meta property=\"og:description\" content=\"Object Relational Mapping (ORM) revolutionizes data access \u2705 Improve maintainability \u2705 Database independence \u2705 Find out more now...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/\" \/>\n<meta property=\"og:site_name\" content=\"Rock the Prototype - Softwareentwicklung &amp; Prototyping\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/\",\"url\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/\",\"name\":\"Object Relational Mapping - Revolutionize database interaction!\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rock-the-prototype.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/Object-Relational-Mapping-ORM.jpg\",\"datePublished\":\"2024-11-05T11:46:00+00:00\",\"description\":\"Object Relational Mapping (ORM) revolutionizes data access \u2705 Improve maintainability \u2705 Database independence \u2705 Find out more now...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/#primaryimage\",\"url\":\"https:\\\/\\\/rock-the-prototype.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/Object-Relational-Mapping-ORM.jpg\",\"contentUrl\":\"https:\\\/\\\/rock-the-prototype.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/Object-Relational-Mapping-ORM.jpg\",\"width\":1024,\"height\":1024,\"caption\":\"Relational Mapping - ORM\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/learn-programming\\\/object-relational-mapping\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/rock-the-prototype\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prototyping Wiki\",\"item\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/wiki\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Object Relational Mapping\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/\",\"name\":\"Rock the Prototype - Softwareentwicklung &amp; Prototyping\",\"description\":\"Prototyping: Software Prototypen, Software entwickeln &amp; Programmieren im Team\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rock-the-prototype.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Object Relational Mapping - Revolutionize database interaction!","description":"Object Relational Mapping (ORM) revolutionizes data access \u2705 Improve maintainability \u2705 Database independence \u2705 Find out more now...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/","og_locale":"en_US","og_type":"article","og_title":"Object Relational Mapping - Revolutionize database interaction!","og_description":"Object Relational Mapping (ORM) revolutionizes data access \u2705 Improve maintainability \u2705 Database independence \u2705 Find out more now...","og_url":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/","og_site_name":"Rock the Prototype - Softwareentwicklung &amp; Prototyping","og_image":[{"width":1024,"height":1024,"url":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/","url":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/","name":"Object Relational Mapping - Revolutionize database interaction!","isPartOf":{"@id":"https:\/\/rock-the-prototype.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#primaryimage"},"image":{"@id":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#primaryimage"},"thumbnailUrl":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM.jpg","datePublished":"2024-11-05T11:46:00+00:00","description":"Object Relational Mapping (ORM) revolutionizes data access \u2705 Improve maintainability \u2705 Database independence \u2705 Find out more now...","breadcrumb":{"@id":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#primaryimage","url":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM.jpg","contentUrl":"https:\/\/rock-the-prototype.com\/wp-content\/uploads\/2023\/10\/Object-Relational-Mapping-ORM.jpg","width":1024,"height":1024,"caption":"Relational Mapping - ORM"},{"@type":"BreadcrumbList","@id":"https:\/\/rock-the-prototype.com\/en\/learn-programming\/object-relational-mapping\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/rock-the-prototype.com\/en\/rock-the-prototype\/"},{"@type":"ListItem","position":2,"name":"Prototyping Wiki","item":"https:\/\/rock-the-prototype.com\/en\/wiki\/"},{"@type":"ListItem","position":3,"name":"Object Relational Mapping"}]},{"@type":"WebSite","@id":"https:\/\/rock-the-prototype.com\/en\/#website","url":"https:\/\/rock-the-prototype.com\/en\/","name":"Rock the Prototype - Softwareentwicklung &amp; Prototyping","description":"Prototyping: Software Prototypen, Software entwickeln &amp; Programmieren im Team","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rock-the-prototype.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/encyclopedia\/4429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/encyclopedia"}],"about":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/types\/encyclopedia"}],"author":[{"embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/media\/3953"}],"wp:attachment":[{"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/media?parent=4429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/categories?post=4429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rock-the-prototype.com\/en\/wp-json\/wp\/v2\/tags?post=4429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}