JPA is an important part of Java ee 5. It greatly simplifies the use of entity beans. But one obvious drawback of JPA is that it is possible to port the database structure to your application without using JPA in principle.ProgramOfCode. This will cause trouble for application maintenance and upgrade.
In this article, "using JPA without principle" mainly refers to defining the relationship between entity beans through annotation. The relationships between these data entities, such as one-to-many, one-to-one, many-to-one, and many-to-many and association operations (cascade), are clearly the concept of databases. To achieve the purpose of ORM, JPA hasSource code.
To a large extent, this migrates the structure and design of the database to the application. This has the following problems:
1. The source code of an application is less readable than the complexity of the database structure. It depends almost entirely on the business logic of the application. If the business logic is complex, it is difficult to define the relationship between entity beans. As you can imagine, the readability of the code will be poor.
2. Poor maintainability of applications once the database structure changes due to business needs, these relationships will need to be redefined.
Iii. Defining complex database structure relationships is almost unrealistic, which is also a limitation of the ORM itself. Porting a database structure to an application is an error. Relational databases are mainly written in the word "relationship", because the database is concerned with data and its integrity (data ). Applications adopt OOP development methods and focus on the operation of "objects" in the system ). Data is the state of an application, and action is the business logic of the application. Status and action are two major elements that constitute an application. While ORM tries to ignore the status and raise the action, it doesn't know that the final result of the "Action" should be implemented in the "State" change. Why is object database management system (odbms) not popular?