Minidao Persistence layer Vs MyBatis

Source: Internet
Author: User
Tags aop

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.