Pros and cons of Mybaits

(1) Advantages:
① Based on SQL statement programming, it is quite flexible and will not have any impact on the existing design of the application or database. SQL is written in XML, which releases the coupling between SQL and program code and facilitates unified management; XML tags are provided , Support the preparation of dynamic SQL statements, and can be reused.
② Compared with JDBC, it reduces the amount of code by more than 50%, eliminates a large number of redundant codes in JDBC, and does not need to manually switch connections;
③ It is compatible with various databases (because MyBatis uses JDBC to connect to the database, so only JDBC supported database MyBatis supports).
④ Can be well integrated with Spring;
⑤ Provide mapping tags to support ORM field relationship mapping between objects and databases; provide object relationship mapping tags to support object relationship component maintenance.
(2) Disadvantages:
① The workload of writing SQL statements is relatively large, especially when there are many fields and associated tables, there are certain requirements for developers to write SQL statements.
② SQL statements depend on the database, resulting in poor database portability, and the database cannot be replaced at will.

Guess you like

Origin blog.csdn.net/jq1223/article/details/114103791