很久没做java后台了,都不知道java发展的怎么样了。
现在ORM框架主流还是hibernate嘛,
ibtais和mybatis哪个用的多点。请大牛指点
补充:mybatis是ibatis的升级,是不是说明ibatis被淘汰了,我司好像还是用ibtais,我想从这两个中选择一个学习,大神们请推荐。
PHP中文网2017-04-17 13:05:43
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!
PHP中文网2017-04-17 13:05:43
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.
大家讲道理2017-04-17 13:05:43
The hibernate and mybatis above are too heavyweight.
You can check out nutz for a one-stop solution. Very lightweight.
高洛峰2017-04-17 13:05:43
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.
大家讲道理2017-04-17 13:05:43
hibernate is probably still mainstream, mybatis is an upgrade of ibatis, it is naturally easier to use, and it also supports annotations!
高洛峰2017-04-17 13:05:43
mybatis is the result of the entire ibatis development team migrating from apache to github. So it's direct inheritance and upgrade.
高洛峰2017-04-17 13:05:43
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. )
巴扎黑2017-04-17 13:05:43
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