Minidao profile and Features
The Minidao is an ultra-lightweight Java Persistence layer framework with mybatis-like SQL capabilities: Supports SQL separation, supports labeling, and supports annotations. Minidao was originally created to address the Hibernate project's ability to support complex SQL, with MyBatis-like flexibility while supporting transactional synchronization.
Has the following characteristics:
- O/R mapping without setting XML, 0 configuration is easy to maintain
- No need to know the knowledge of JDBC
- Separation of SQL statements from Java code
- Only interface definition, no interface implementation required
- SQL support scripting language (powerful scripting language, Freemarker syntax)
- Supports seamless integration with hibernate lightweight
- Supports automatic and manual transaction processing
- Better performance than MyBatis
- Easier to use than MyBatis
- SQL Support Annotation Method
- SQL supports standalone file mode, SQL file naming rules: Class name _ Method name; SQL files are easier to locate, the bigger the project the more obvious the advantage
- The SQL tag uses the basic syntax of Freemarker
The original intention of Minidao?
The hibernate-based EE project has a pain sickness, a lack of SQL capability for complex operations, poor SQL optimization, and no separation. This time people think of integration MyBatis, but a project both hibernate and use MyBatis, it seems very heavy business is not control. It is common practice to use SPRINGJDBC to write native SQL, but there are also problems where SQL cannot be separated and has no logical tagging capability. So in order to solve this pain, JEECG for the Springjdbc+freemarker did a package, out of such a lightweight persistence layer, you can let Hiberate have mybatis the same SQL flexibility, while supporting transactional unified, SQL tag capabilities.
Version upgrade log
- 1. Simplify the Pom.xml configuration and delete unwanted dependencies
- 2. Log rewriting, unified implementation of the interface
- 3. Upgrade Freemarker version
- 4. Provide transaction demo, annotation method
- 5. Normalize code, log printing normalization, improve efficiency and versatility
SOURCE download
- Source: Https://github.com/zhangdaiscott/MiniDao
- Https://gitee.com/jeecg/minidao
- Forum: www.jeecg.org
- Document: Http://minidao.mydoc.io
- QQ Exchange Group: ①325978980
SOURCE Interpretation:
@MiniDao Public interface EmployeeDAO {public list<map> getallemployees (@Param ("employee") employee Employee); Employee GetEmployee (@Param ("Empno") String empno); Map Getmap (@Param ("Empno") string empno, @Param ("name") string name); @Sql ("SELECT count (*) from employee") Integer GetCount (); int update (@Param ("employee") employee employee); void Insert (@Param ("employee") employee employee);
SQL definition:
SELECT * FROM employee where 1=1 < #if employee.age?exists> and age =: employee.age </#if >
< #if employee.name?exists> and name =: Employee.Name </#if > < #if employee.empno? Exists> and empno =: employee.empno </#if >
minidao_1.6.4 release, lightweight Java Persistence Framework, Hibernate project Assist tool