Atitit. disadvantages of orm and market share of orm framework, selection attilax summary, ormattilax
Atitit. disadvantages of orm and market share of orm framework, selection attilax Summary
1. Requirements of the attilax orm framework 1
2. orm framework market share 2
3. spring jdbc templt 3
4. poor use of eclipselink/toplink 4
5. Summary of jooq 4
6. attilax selection atiorm 4
7. Refer to 4
1. attilax orm framework requirements
1. No configuration file or annotation is required .. Generate SQL directly from map and json
2. Obtain SQL directly .. No need to connect to the database .. Easy debugging. Or this SQL transmission.
Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://blog.csdn.net/attilax
2. Market Share of orm framework
Orm frameworks in use
Hb 67
Jdbc 22
Spring jdbc template 20
Eclipselink 13
Mybatis 7
Jooq 2
Datasource: REBELLABS (website research)
Conclusion.
However, in any case, just using the ORM framework, the landlord can rest assured to learn without worrying about the time cost and will not take too much time.
3. spring jdbc templt
2. Use the NamedParameterJdbcTemplate class to implement JDBC. parameters are transmitted using the Map set.
· @ 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 ("inserted successfully! ");
·} Else {
· System. out. println ("insertion failed! ");
·}
·}
· @ 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 ("Update successful! ");
·} Else {
· System. out. println ("update failed! ");
·}
·}
4. poor use of eclipselink/toplink 5. Summary of 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.w.age.equal ("DE "))
5. and (T_BOOK.PUBLISHED.greaterThan (parseDate ('2017-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 is easy to use with ide .. But it cannot map json to automatically, so it is still troublesome.
6. Select atiorm for attilax
It seems that spring temple is best to use... it's best to use tired hanging three, so it's easy to use transactions... ma transac, you can't save it...
Zi Haga from orm LAN ..
7. Advantages of orm in interface use
The 10-json interface is provided directly, which can be directly converted into an orm for 10 ease of use ..
8. Reference
Add, delete, modify, and query using JDBC in Spring-iteyetechnical website .htm