Data persistence: Hibernate vs JDBC queries vs MyBatis

转载 2012年03月30日 11:41:25
I'm newbie with GWT/GXT and I'm looking for best persistence way for my future apps. I was considering many variants of doing that so I decided to draw a graph (see attachment).

So my conclusions are:
1) Hibernate is the best persistence framework but it hates cooperation with GWT and a specially with GXT
2) JDBC it was just a joke
3) MyBatis is really great tool for gaining data from db, but writing mappers is the worst thing ever, but its fast, efficient and has great possibilities not seen in Hibernate.
4) Dozzer is server and user resourcess killer. You must write a lot of boiler plate code and it just copy data (sometimes a lot). Don't use it at any cost!!! Imagine server that runs 100 sessions and each bean request must use Dozzer.
5) DTO - similar situation. It's boilerplate, and it's just transforming one data type into other. There is no serious data processing. Use server resourcess wisely.
6) Gilead is copying hibernate beans states. It could be dangerous (just heard from few comments), hard to configure and integrate with other IoC frameworks (Guice in my case).
6) Don't transform POJO int BeanModel on the client side. JavaScript is really slow and it slows down the whole client.
7) Best practise for me and maybe for you: find the shortest path on the graph from DB to the BaseModel bean on the client side.
8) MyBatis allows to map query results to the BaseModel beans (tested) so they don't need to be transformed many times and you don't have to care about it at all. The only thing is writing proper mappings.

This is my personal opinion and remember that I'm newbie. Please explain me if I'm wrong and give cons arguments. Maybe you know another ORM or similar to MyBatis framework that could give me as short path.
Attached Images


Hibernate VS MyBatis 区别

关于O/R Mapping的理论,网上也有很多。其实完整的O/R mapping理论是想让程序员从数据的CRUD中解放出来,专注于使用OO的思想来实现业务逻辑,使用OO的思想当然就很大程度上需要遵守S...

【项目总结】持久化工具 hibernate VS mybatis

一、What?1、在项目中用到的hibernate举例: /** * 根据选题Id查询已选学生学号--2016年8月20日16:05:30 * @param tgdTopic...

[ElasticSearch2.x]Queries vs Filters

1. 查询与过滤Elasticsearch 使用的查询语言(DSL) 拥有一套查询组件(queries),这些组件可以以无限组合的方式进行搭配(mixed and matched)。这套组件可以在以下...

【Hibernate错误解决办法】Could not execute JDBC batch update; Data too long for column 'name' at row 1


ORM框架--------Hibernate、Mybatis与Spring JPA-Data之间的区别

1.概念: Hibernate :Hibernate是一个开放源代码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,使得Java程序员可以随心所欲的使用对象编程思维来操纵数据库。着力...


  • 2011年01月03日 10:37
  • 10.5MB
  • 下载

基于maven的多框架和多视图融合技术(Struts1、Struts2、Spring、SpringMVC、Hibernate、Ibatis、MyBatis、Spring Data JPA、DWR)

该项目基于maven3.0构建的,项目中融合了Struts1、Struts2、Spring、SpringMVC、Hibernate、Ibatis、MyBatis、Spring Data JPA、Spr...

Spring Data与Hibernate、Mybatis的区别

本文为转载文章,目的是给自己整理思路使用。 转载自: 1.概念:...
您举报文章:Data persistence: Hibernate vs JDBC queries vs MyBatis