MyBatis是否遵循JPA? [英] Does MyBatis follows JPA?

查看:815
本文介绍了MyBatis是否遵循JPA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为我的第一个ORM,我已经在myBatis上工作了几个月.现在,我正在尝试学习Hibernate/JPA等其他内容.起初,很难理解Hibernate和JPA之间的区别.经过几分钟的研究,我了解到JPA只是一个规范,而Hibernate是JPA的具体实现.在此视频中:链接一切都得到了很好的解释,但视频的作者正在处理myBatis( iBatis),例如JPA实施.这是一个好方法吗? myBatis是否遵循JPA?有一个答案,但是11岁了: link2 .在带有myBatis的应用程序中,我不必使用JPA特定的对象/注释,因此这意味着myBatis是否不遵循JPA?

I've been working with myBatis for a few months as my first ORM. Now I'm trying to learn something else like Hibernate/JPA. At first it was hard to understand a difference between Hibernate and JPA. After few minutes of research I understood that JPA is just a specification and Hibernate is concrete implementation of JPA. In this video: link everything is nicely explained but author of the video is treating myBatis(iBatis) like JPA implementation. Is this a good approach? Does myBatis follows JPA? There is one answer, but is 11 yrs old: link2. In my apps with myBatis I don't have to use JPA specific objects / annotations, so it means that myBatis doesn't follow JPA?

推荐答案

myBatis不实现JPA.

myBatis does not implement JPA.

在您提到的视频中,关于ibatis/mybatis的JPA实现没有任何意义.将mybatis视为ORM(实际上是ORM).在视频中,据说休眠,ibatis和toplink都有非常不同的界面,您不能轻易地将它们替换为另一个.拥有一个允许与不同实现一起使用的API会很好.但这并不意味着所有提到的ORM都实现了JPA(就是这样的API).

In the video you mentioned there's nothing about ibatis/mybatis being a JPA implementation. mybatis is treated as ORM (which it is) instead. In the video it is said that hibernate, ibatis and toplink all have very different interfaces and you can't replace one with another effortlessly. And it would be nice to have one API that allows to work with different implementations. But it does not imply that JPA (being such an API) is implemented by all mentioned ORMs.

这篇关于MyBatis是否遵循JPA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆