atitit.orm的缺点与orm框架市场占有率,选型attilax总结

atitit.orm的缺点与orm框架市场占有率,选型attilax总结spring

 

1. attilaxorm框架要求 1sql

2. orm框架市场占有率 2数据库

3. spring jdbc templt 3json

4. eclipselink /toplink  很差用 4segmentfault

5. jooq 的总结 4mybatis

6. attilax的选择 atiorm 4框架

7. 参考 4eclipse

 

1. attilaxorm框架要求

 

1.无需配置文件或注解。。直接从mapjson生成sqlide

2.直接获取sql。。无需链接数据库。。方便调试。或这sql传输。学习

 

做者:: 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.csdn.net/attilax

 

2. orm框架市场占有率

 

orm frameworks in use

hb 67

jdbc  22

spring jdbc template 20

eclipselink 13

mybatis 7

jooq 2

 

datasource:::REBELLABS (  WEBSITE RESEARCH 

结论如图。
但不管如何,仅仅就使用ORM框架而言,楼主大可放心去学习,不用担忧时间成本的问题,不会占太多时间的

 

 

3. spring jdbc templt

二、使用NamedParameterJdbcTemplate类,实现JDBC,参数是用Map集合传递的

·    @Override  

·      public void insert(User entity) {  

·          // TODO Auto-generated method stub  

·          String sql="insert into user(name,age,sex) values(:name,:age,:sex)";  

·          Map<String,Object> map=new HashMap<String,Object>();  

·          map.put("name", entity.getName());  

·          map.put("age", entity.getAge());  

·          map.put("sex", entity.getSex());  

·          int temp=npjt.update(sql, map);  

·          if(temp>0){  

·              System.out.println("插入成功!");  

·          }else{  

·              System.out.println("插入失败!");  

·          }  

·      }  

 

·    @Override  

·      public void update(User entity) {  

·          // TODO Auto-generated method stub  

·          String sql="update user set name=:name,age=:age,sex=:sex where id=:id";  

·          Map<String,Object> map=new HashMap<String,Object>();  

·          map.put("name", entity.getName());  

·          map.put("age", entity.getAge());  

·          map.put("sex", entity.getSex());  

·          map.put("id", entity.getId());  

·          int temp=npjt.update(sql, map);  

·          if(temp>0){  

·              System.out.println("更新成功!");  

·          }else{  

·              System.out.println("更新失败!");  

·          }  

·      }  

 

4. eclipselink /toplink  很差用

5. jooq 的总结

 

1. create.select(T_AUTHOR.FIRST_NAME, T_AUTHOR.LAST_NAME, count())  

2.       .from(T_AUTHOR)  

3.       .join(T_BOOK).on(T_BOOK.AUTHOR_ID.equal(T_AUTHOR.ID))  

4.       .where(T_BOOK.LANGUAGE.equal("DE"))  

5.       .and(T_BOOK.PUBLISHED.greaterThan(parseDate('2008-01-01')))  

6.       .groupBy(T_AUTHOR.FIRST_NAME, T_AUTHOR.LAST_NAME)  

7.       .having(count().greaterThan(5))  

8.       .orderBy(T_AUTHOR.LAST_NAME.asc().nullsFirst())  

9.       .limit(1, 2)  

10.       .forUpdate();  

jooq使用ide会方便。。可是不能自动map json to ,因此,仍是麻烦。

6. attilax的选择 atiorm

看起来spring temple最好使用...使用累挂三,好香要事务才能使用了...transac,走不能保存...

 

子好嘎自orm..

 

7. orm的优势在接口使用中

直接提供的走十json的接口,,直接转换成个orm走十好用啊..

8. 参考

Spring中使用JDBC作的增删改查 - - ITeye技术网站.htm

相关文章
相关标签/搜索