iBATIS与Hibernate的区别

来源:互联网 发布:聚合数据怎么样 编辑:程序博客网 时间:2024/06/06 00:44

Both Hibernate and iBATIS are open source Object Relational Mapping (ORM) tools available in the industry. Use of each of these tools depends on the context you are using them.
iBATISHibernateiBATIS is simpler. It comes in a much smaller package size.Hibernate generates SQL for you which means you don’t have to spend time on generating SQL.iBATIS is flexible. It offers faster development time.Hibernate is highly scalable. It provides a much more advanced cache.iBATIS uses SQL which could be database dependent.Hibernate uses HQL which is relatively independent of databases. It is easier to change db in Hibernate.iBatis maps the ResultSet from JDBC API to your POJO Objets, so you don’t have to care about table structures.Hibernate maps your Java POJO objects to the Database tables.It is quite easy to use stored procedure in iBATIS.Use of stored procedures is a little difficult in Hibernate.Hibernate和iBATIS都是开源的对象关系映射工具。如何选择取决于你应用场景。

iBATISHibernateiBATIS 简单,打包也小。Hibernate 自动生成SQL,所以你不需要去再花时间去生成SQL.iBATIS 比较灵活,可以节约开发时间。Hibernate是高度可扩展的。它提供了更先进的缓存。iBATIS 使用SQL语句所以它对数据库是有依赖的。Hibernate 使用独立于数据库的HQL,这样就可以在不同类型的数据库中随意切换。iBatis 从JDBC的返回集(ResultSet)映射到POJO对象,所以你可以不用关心数据库中表的结构。 Hibernate映射你的Java POJO对象到数据库表。iBatis中可以很容易的使用存储过程。相对而言 Hibernate使用存储过程有点麻烦。原文链接:

http://www.tutorialspoint.com/ibatis/ibatis_vs_hibernate.htm


0 0
原创粉丝点击