Home  >  Q&A  >  body text

java - 关于Hibernate与Mybatis的区别

在J2EE领域,数据持久层这块主流的框架有Hibernate与Mybatis,二者的主要区别体现在哪里?在生产环节,二者主要适用于什么场景呢???

阿神阿神2716 days ago344

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:50:46

    I think the principle is whichever one is easier to use

    I am also a novice, so I will just talk about my personal understanding. I welcome guidance from experts

    h is more heavyweight and complex than m. It is easy to get started but difficult to master, and it is difficult to master. When I first started learning, I thought it would be better not to even write SQL. Later I found out that the disadvantage of this is that it cannot be performance tuned. If you let h execute SQL, it can be done, but it goes against his original intention. Moreover, it is not very comfortable for a table to correspond to a large amount of XML.
    m is a little lighter, you can directly write SQL (template), it is easy to get started, it is decoupled, and it feels very cool.
    From my shallow perspective, it seems that m is more popular than h now.
    Finallyyou will know after using it

    reply
    0
  • Cancelreply