Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Hibernate and MyBatis

 
Avinash Haridasu
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

I recently started learning Hibernate.

I want to know whether Hibernate is better over MyBatis or vice - versa.

Could any one suggest me any Book on Hibernate.
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea about MyBatis but for books: "Java Persistence with Hibernate" is the best book you can read to learn Hibernate in depth.
 
Zoran Roncevic
Greenhorn
Posts: 13
Eclipse IDE Hibernate MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avinash Haridasu wrote:Hi Friends

I recently started learning Hibernate.

I want to know whether Hibernate is better over MyBatis or vice - versa.

Could any one suggest me any Book on Hibernate.


If you don't want to read the whole thing try this:
http://www.youtube.com/watch?v=Yv2xctJxE-w

This guy is great! The series is 30 something tutorials up to 15 min max each. He covers everything in good details. After this tutorials you will be good enough to read the documentation by your self to figure out the rest that you don't know.
Just hit subscribe to thank the guy.

As far as the MyBatis goes, I gave it a look and it quite similar to Hibernate. Some names of the annotations are different but they do the same thing. I wouldn't say it easier than Hibernate, but that is just my thought. maybe somebody that has experience with Mybatis should say something
 
Kaushik Yeleswarapu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you trying to decide on which way to go - hibernate or mybatis. I would say it depends - in which stage of the project you are in. If you are in control of the Class model - starting from the scratch, then you could very well design your classes in line with Hibernate principles. If you are trying to do one off thing in existing application which is following a different db framework, then I would say using mybatis would be very helpful. Also Mybatis is a nobrainer in terms of maintenance, you could directly work/concentrate on the SQL queries - banking on your SQL knowledge. It would be very easy for a new joinee in the team to pickup mybatis when compared to hibernate. While for Hibernate, there is a learning curve involved. Especially if there are some complex joins involved in the application, then Hibernate is going to be quite a challenge though. With mybatis you could come up with the exact query in any query analyzer and use it directly in the mapper file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic