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?
Asked
Active
Viewed 2,711 times
2
-
No. Nowhere anywhere on the internet does myBatis docs mention implementing JPA. The JPA API is widely documented and your usage will NOT use those classes/methods, so how can it??? The link you provided asked the same question (for iBatis, which is identical to myBatis since it was the original before a simple renaming) ... and the answer says "No, absolutely not". How clear can you get???? – Oct 21 '18 at 16:24
-
Dup of https://stackoverflow.com/questions/33652936/spring-data-jpa-mybatis – Oct 21 '18 at 17:01
-
@BillyFrost I know that question is little dumb. I just wanted to be sure if I understood it in a good way, because concept of JPA is new for me. Anyway, thank you for your answer. – Sensibles93 Oct 21 '18 at 17:22
1 Answers
2
myBatis does not implement JPA.
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.

Roman-Stop RU aggression in UA
- 14,905
- 3
- 48
- 53