Introduction and features of Minidao
Minidao is JEECG's own persistence solution, which integrates hibernate entity maintenance and mybaits SQL separation advantages. Has the following characteristics
L/O mapping do not need to set XML, 0 configuration easy to maintain
L don't need to know about JDBC knowledge
• Separation of SQL statements and Java code
L can automatically generate SQL statements
L Interface and implementation separation, not write persistent layer code, user only write interface, and some interface methods
l correspond to SQL. It will automatically generate implementation classes via AOP
L support automatic transaction processing and manual transaction processing
L support lightweight seamless integration with hibernate
L MINIDAO The two main advantages of consolidation Hibernate+mybatis support for entity maintenance and SQL Detach SQL support scripting language
L SQL Performance is superior to MyBatis
※ Backward-compatible hibernate entity maintenance Mode, entity additions and deletions to check SQL automatic generation
&vs MyBatis
Same point:
• Separation of SQL statements and Java code
different points:
L/O mapping do not need to set XML, 0 configuration, simple and easy to use
L can automatically generate SQL statements
L Interface and implementation separation, without writing persistent layer code, users need to write interface, and some interface methods corresponding to the SQL. It will automatically generate implementation classes via AOP
L support lightweight seamless integration with hibernate
L SQL supports more powerful scripting languages and can write logical processing
L SQL Performance is superior to MyBatis
L SQL supports passing multiple parameters map/object/list/wrapper types can be
MyBatis only supports one parameter <Map/Object>
SQL Performance Comparison
(Minidao SQL content with file storage)
Minidao SQL time consuming: 54 milliseconds (SQL template first read from file, second read from cache) method loads SQL into cache the first time it executes
Minidao Sql Time consuming: 4 ms
Minidao Sql Time consuming: 4 ms
Minidao Sql Time consuming: 5 ms
(Minidao SQL content with @sql tags)
Minidao Sql Time consuming: 6 ms
Minidao Sql Time consuming: 1 ms
Minidao Sql Time consuming: 1 ms
Minidao Sql Time consuming: 2 ms
(MyBatis loads XML into the cache when sesion is initialized, so the first execution is faster than Minidao)
MyBatis Sql time consuming: 18 milliseconds mybatis session initialization, loading XML into cache
MyBatis Sql Time consuming: 6 ms
MyBatis Sql Time consuming: 5 ms
MyBatis Sql Time consuming: 9 ms
(SPRINGJDBC)
SPRINGJDBC Sql Time consuming: 10 ms
SPRINGJDBC Sql Time consuming: 1 ms
SPRINGJDBC Sql Time consuming: 1 ms
SPRINGJDBC Sql Time consuming: 1 ms
Minidao Special topic:http://zhangdaiscott.github.io/MiniDao/
JEECG Special topic : http://zhangdaiscott.github.io/jeecg/
Technical Forum: www.jeecg.org