The origin of ORM:
currently popular programming languages, such as Java, C #, and so on, they are object-oriented programming language, and the current mainstream database products, such as ORACLE,DB2, is still a relational database. The development and coordination of programming languages and underlying databases has spawned an ORM framework. ORM Framework can be used as a bridge between object-oriented programming language and database. ORM Framework is an intermediate solution to the development of object-oriented programming language and relational database in different stages.
Why use ORM?
the advantages of object-oriented programming language representation:
1. Object-oriented modeling and Operation
2, polymorphism, inheritance
3. Abandon the difficult process of understanding
4, easy to use, easy to understand
However, the development of the database is not synchronized with the programming language, so some advantages of the relational database system are also the object-oriented language can not be compared at present, this time the ORM framework is out. Only the object-oriented programming language is still used, the underlying database is still used, and the ORM tool is indispensable in the middle. With the ORM framework, the program is no longer directly accessing the database, but the object-oriented operation of persistent objects (such as additions and deletions), and the ORM framework is to translate these object-oriented operations into the underlying SQL operations.
the ORM definition:
ORM: Object-Relational Mapping (English: Relational Mapping) is a program technology that enables the conversion of data between different types of systems in an object-oriented programming language. In effect, it actually creates a "virtual object database" that can be used in a programming language.
the basic mapping method of ORM:
1. Data type mapping mode
2. Class Mapping model
3. Correlation mapping mode
4. Reference mapping mode
The main use of the SSH Online mall is the association mapping mode: one to the correlation mode, a one-to-many correlation pattern, many-to-many correlation pattern, in the next article will introduce the ORM basic mapping way.
Summary:
The ORM methodology is based on three core principles: simple: Modeling data in the most basic form. Communication: The database structure is documented in a language that anyone can understand. Accuracy: Create a properly standardized structure based on the data model.