Skip to content

Latest commit

 

History

History

object-relational-mapper

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Object-Relational Mapper (ORM)

An Object-Relational Mapper (ORM) is a programming technique that allows developers to interact with a relational database using object-oriented programming (OOP) concepts. It provides a higher-level abstraction layer between the application code and the database, eliminating the need for manual SQL queries and reducing the complexity of data access.

Key aspects:

  • Mapping Objects to Tables: With an ORM, developers can define classes and objects in their application code that correspond to tables and records in a relational database.

  • Querying Language: ORMs often provide a querying language or a query builder interface that allows developers to express database queries using object-oriented syntax. This abstracts away the specifics of the underlying database language (e.g., SQL) and provides a more developer-friendly way to use data.

  • CRUD Operations: ORMs often provide methods and APIs to perform common database operations such as Create, Read, Update, and Delete (CRUD). Instead of writing raw SQL queries, developers can use the ORM's API methods to interact with the database.

  • Data Relationships: ORMs facilitate the management of relationships between database tables/entities. An ORM allows developers to define relationships such as one-to-one, one-to-many, and many-to-many, and handles the complexities of joins across tables.

  • Data Integrity: ORMs often include features for data validation and integrity. An ORM allows developers to define constraints and rules on the object model, ensuring that the data stored in the database adheres to validation criteria and integrity constraints.