MyBatis leaves query design with your team
MyBatis maps SQL results to Java objects while leaving SQL statements in XML or annotations. That is useful when reviewing the actual query is part of maintaining the application. It also means the team must maintain the query and its mapping together.
The getting started guide shows both XML statements and annotated mapper interfaces. Annotations suit simple statements; the guide says the most advanced mappings, including nested join mapping, still require XML. Treat the README's claim that simplicity is its biggest advantage as the project's assessment, rather than a measured comparison with other persistence tools.
What our recorded run established
Our run was recorded on October 7, 2026 at commit 34147d0bd2f5ed0016ef367c92b25e174149326b. The build output identified the checkout as MyBatis 3.6.0-SNAPSHOT. This is distinct from the supplied documentation labelled version 3.5.19, last published January 2, 2025.
The harness step labelled install returned exit code 0 after 585 seconds. Its retained tail contains only a JAVA_TOOL_OPTIONS message. That is evidence of successful step completion, without enough output to verify dependency downloads or installation of a usable artifact.
The build command returned exit code 1 after 10 seconds. The test command returned exit code 1 after 8 seconds. Both stopped at the same Maven enforcer rule: installed Maven 3.9.9 was outside the allowed range [3.9.16,). The retained logs show enforcement before compilation or test execution. No individual test results were recorded, so these commands do not show that MyBatis tests failed.
The environment record lists 3 CPUs, 10 GB of memory and image lab-jvm:21. The image name alone does not verify the running JDK. The scan recorded 2,073 files, approximately 116,941 source lines, a 6.6 MB checkout and 7 CI workflows. It detected no Dockerfile. Its testsDir=false flag is a detection result, not an inventory of test coverage.
The README lists test counts that vary by platform and JDK and explains that some tagged groups are excluded by default. Those are upstream statements, not passing-test counts from our run. We performed no new execution, database workload or performance benchmark for this review.
Adding the library differs from building its source
The getting started guide describes using the MyBatis JAR or a Maven dependency. Application configuration includes a data source, transaction management and mapper definitions. A SqlSessionFactory supplies sessions through which the application executes mapped statements.
Our Maven mismatch belongs to the measured 3.6.0-SNAPSHOT source checkout. It does not demonstrate that consuming the published 3.5.19 library requires Maven 3.9.16. Before contributing to that checkout, use a Maven version accepted by its build and check its test exclusions. Before application adoption, configure a representative query against your own database.
Session ownership is part of the adoption decision
The getting started guide says each thread should have its own SqlSession and that sessions are not thread safe. Keep unmanaged sessions within a request or method and close them reliably. The guide uses try-with-resources for this purpose.
The Java API guide describes the default session as having a transaction scope without auto-commit, a connection obtained from the configured data source and the driver's or data source's default isolation level. It also documents explicit commit and rollback behavior. MyBatis-Spring and MyBatis-Guice provide separate integration paths for declarative transaction handling.
For an adoption trial, check a successful write and a rolled-back write with the transaction configuration you intend to deploy. This is a recommended next step, not work completed in our recorded run.
Result mapping and SQL substitution need review
The mapper XML guide describes automatic mapping for simple results and explicit result maps for more complex relationships. Start with a small mapping and verify its returned objects before expanding it.
The guide also distinguishes parameter binding through #{} from direct string substitution through ${}. It warns against passing user input unchanged into substituted SQL. This is a documented usage constraint, not a security finding from our sandbox.
The Java API guide documents a session-local cache and a second-level cache. The XML guide describes namespace cache configuration and cache references. Include cache behavior in your mapper review if you enable it; our run did not exercise either cache.
The OGNL report does not settle release impact
Issue 3574 contains a user's report of high-concurrency thread blocking, naming MyBatis 3.5.19 and OGNL 3.4.9. A maintainer replied that OGNL 3.4.9 had only just been merged and was unreleased for MyBatis, and asked for clarification of the affected version.
That exchange leaves the report's release attribution unresolved in the supplied evidence. It does not establish that released MyBatis 3.5.19 contains the stated OGNL version or that every high-concurrency service is affected. We did not reproduce the report, and the supplied extract does not verify the previously asserted upgrade pull request.
Choosing a persistence approach
jOOQ describes itself as an internal DSL and source code generator that models SQL as a type-safe Java API. Consider it when query construction in Java and generated types are the desired workflow.
Hibernate ORM describes object/relational mapping and synchronization of in-memory changes with the database. Consider it when that object persistence model matches the application.
MyBatis fits the reader who wants explicit SQL coupled to Java mappings. Our source-build result leaves compilation, test outcomes, database compatibility and runtime performance unverified. A representative mapper and transaction trial is the next useful check.
How to read the scores
These are editorial assessments of the supplied evidence, not benchmark results. The scale is 1 for major demonstrated obstacles or little usable evidence, 2 for limited validation, 3 for a documented path with material gaps, 4 for detailed supporting evidence and 5 for broad corroboration. Missing evidence reduces confidence rather than proving poor product quality.
Setup receives 2/5 because source validation stopped at toolchain enforcement and application setup was not exercised. Documentation receives 4/5 because the supplied guides explain configuration, mapping, session lifecycle, transactions and caches. Community receives 2/5 because the issue exchange shows participation but does not establish adoption or representative support responsiveness. Maturity receives 3/5 because a documented 3.5.19 release and a later 3.6.0-SNAPSHOT checkout are visible, while compatibility and operational reliability were not validated.

