Atitit.orm 's shortcomings and ORM Framework market share, selection attilax Summary
1. Attilax 's ORM Framework Requirements 1
2. ORM Framework Market share 2
3. Spring JDBC TEMPLT 3
4. Eclipselink/toplink not good for 4
5. Summary of Jooq 4
6. selection of attilax atiorm 4
7. Reference 4
1. Attilaxof theORMFramework Requirements
1. No configuration files or annotations are required. generate SQL directly from map,JSON
2. Get SQLdirectly: No database connection required. Easy to Debug. Or this SQL transport.
Author:: Old Wow's paw attilax Ayron, email:[email protected]
Reprint please indicate source: Http://blog.csdn.net/attilax
2. OrmFrame Market Share
ORM Frameworks in use
HB 67
JDBC 22
Spring JDBC Template 20
Eclipselink 13
MyBatis 7
Jooq 2
Datasource:::rebellabs ( WEBSITE )
Conclusion.
But in any case, just use ORM Framework, the landlord can rest assured to learn, do not worry about the cost of time problems, will not take up too much time
3. Spring JDBC TEMPLT
2, using the Namedparameterjdbctemplate class, the implementation of JDBC, parameters are sent by the map collection
· @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 (" Insert succeeded! ");
· }else{
· System.out.println (" insert 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 succeeded! ");
· }else{
· SYSTEM.OUT.PRINTLN (" update failed! ");
· }
· }
4. Eclipselink/toplinkBad Use5. Jooqthe summary
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.. t_author. LAST_NAME.ASC (). Nullsfirst ())
9: Limit (1, 2)
Ten. Forupdate ();
Jooq using the IDE is convenient. But it doesn't automatically map json to, so it's still a hassle.
6. AttilaxThe ChoiceAtiorm
It looks like Spring Temple is best used ... use tired hanging three , Good to have a business to use ... Horse Transac, Go can't save ...
The son of a good GA from the orm Orchid .
7. Ormthe advantages of the interface in the use of
Directly provided by the Walk ten JSON interface , Direct conversion to an orm Walk ten easy to use AH .
8. Reference
Spring uses JDBC to make additions and deletions --iteye technology website . htm
Atitit.orm's shortcomings and ORM framework market share, Selection Attilax summary