hibernate and ibtas (mybatis) emerged to solve different problems.
Hibernate looks at the database from the perspective of objects. All tables at the database level are objects in Hibernate's view. If the objects are objects, they will naturally have one-to-many, one-to-one, etc. relationships. Hibernate completely encapsulates database-level operations at the object level. So it is a complete ORM tool. The biggest benefit is that developers can complete database-level operations with a small amount of code, which greatly improves development efficiency and does not need to write a lot of JDBC code.
But after all, the database cannot just be viewed as an object. It has its own organization method and its own indexing mechanism. When your database reaches a certain level, hibernate will be very difficult, because when using objects, Organizing the relationship between objects will make the SQL mapped to the database level very complicated.
Precisely when this kind of complexity is not what the database execution engine expects, it will lead to various slow queries. Therefore, a semi-automatic method like ibtas (mybatis) appeared later to solve the performance problem. The interaction with the database level is still through specific SQL, but it provides a mechanism to simplify the development workload, that is, the work of writing JDBC.
The current mainstream is basically ibtas (mybatis), especially for Internet applications, hibernate is too heavy!
The conclusion is as shown in the figure.
But in any case, as far as using the ORM framework is concerned, you can rest assured to learn without worrying about time costs, and it will not take up too much time.
Hibernate is too heavy and is not recommended for novices to learn. In addition, there are a lot of concepts in it that cannot be manipulated by novices. It is recommended that you learn mybatis, which is easy to get started and semi-automatic ORM. It requires writing sql, and you can also learn and become proficient in sql. You can also get more; Ningwai, don’t ask whether it is mainstream or not. Mybatis and hibernate are chosen based on their characteristics, performance, development efficiency, and staff proficiency in the project (it seems that Gaopingfa’s websites now use mybatis (more), Ningwai, your company uses ibatis in its projects, then you should learn more about it, and then understand its upgrade mybatis (actually this is just the name changed by ibatis after it moved out of apache, and everything is inherited and improved. )
Mybatis is just the second name of ibatis. It is recommended to use mybatis, a lightweight ORM framework with high execution efficiency and easy to write various SQL
hibernate and ibtas (mybatis) emerged to solve different problems.
Hibernate looks at the database from the perspective of objects. All tables at the database level are objects in Hibernate's view. If the objects are objects, they will naturally have one-to-many, one-to-one, etc. relationships. Hibernate completely encapsulates database-level operations at the object level. So it is a complete ORM tool. The biggest benefit is that developers can complete database-level operations with a small amount of code, which greatly improves development efficiency and does not need to write a lot of JDBC code.
But after all, the database cannot just be viewed as an object. It has its own organization method and its own indexing mechanism. When your database reaches a certain level, hibernate will be very difficult, because when using objects, Organizing the relationship between objects will make the SQL mapped to the database level very complicated.
Precisely when this kind of complexity is not what the database execution engine expects, it will lead to various slow queries. Therefore, a semi-automatic method like ibtas (mybatis) appeared later to solve the performance problem. The interaction with the database level is still through specific SQL, but it provides a mechanism to simplify the development workload, that is, the work of writing JDBC.
The current mainstream is basically ibtas (mybatis), especially for Internet applications, hibernate is too heavy!
Use SpringJdbc, it is more flexible than hibernate. I really don’t know what is good about ibatis. Its functions can be realized by SpringJdbc.
The hibernate and mybatis above are too heavyweight.
You can check out nutz for a one-stop solution. Very lightweight.
The conclusion is as shown in the figure.
But in any case, as far as using the ORM framework is concerned, you can rest assured to learn without worrying about time costs, and it will not take up too much time.
hibernate is probably still mainstream, mybatis is an upgrade of ibatis, it is naturally easier to use, and it also supports annotations!
mybatis is the result of the entire ibatis development team migrating from apache to github. So it's direct inheritance and upgrade.
Spring Data JPA is also a good choice
Hibernate is too heavy and is not recommended for novices to learn. In addition, there are a lot of concepts in it that cannot be manipulated by novices. It is recommended that you learn mybatis, which is easy to get started and semi-automatic ORM. It requires writing sql, and you can also learn and become proficient in sql. You can also get more; Ningwai, don’t ask whether it is mainstream or not. Mybatis and hibernate are chosen based on their characteristics, performance, development efficiency, and staff proficiency in the project (it seems that Gaopingfa’s websites now use mybatis (more), Ningwai, your company uses ibatis in its projects, then you should learn more about it, and then understand its upgrade mybatis (actually this is just the name changed by ibatis after it moved out of apache, and everything is inherited and improved. )
mybatis, convenient for SQL optimization and low learning cost
Mybatis is just the second name of ibatis. It is recommended to use mybatis, a lightweight ORM framework with high execution efficiency and easy to write various SQL