MCPcopy
hub / github.com/mybatis/mybatis-3

github.com/mybatis/mybatis-3 @mybatis-3.5.19 sqlite

repository ↗ · DeepWiki ↗ · release mybatis-3.5.19 ↗
8,801 symbols 31,809 edges 1,316 files 645 documented · 7%
README

MyBatis SQL Mapper Framework for Java

build Coverage Status Maven central Sonatype Nexus (Snapshots) License Stack Overflow Project Stats

mybatis

The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented applications. MyBatis couples objects with stored procedures or SQL statements using an XML descriptor or annotations. Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.

Essentials

Contributions

Mybatis-core is now being auto formatted. Given nature of some code logic with mybatis, it is more appropriate to force a formatting structure manually for snippets such as sql statements. To do so, add following blocks around code.

  • // @formatter:off to start the block of unformatted code
  • // @formatter:on to end the block of unformatted code

If comment sections need same behaviour such as javadocs, note that the entire block must be around entire comment as direct usage does not properly indicate that formatter treats it all as one comment block regardless.

Tests

Mybatis-3 code runs more expressive testing depending on jdk usage and platform.

By default, we set <excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups> which will exclude a subset of tests with @Tag('TestcontainersTests') and @Tag('RequireIllegalAccess').

When we run on ci platform, we further make adjustments as needed. See here for details.

As of 12/28/2024, using combined system + jdk will result in given number of tests ran. This will change as tests are added or removed over time.

without adjusting settings (ie use as is, platform does not matter)

  • any OS + jdk 17 = 1899 tests
  • any OS + jdk 21 = 1899 tests
  • any OS + jdk 23 = 1899 tests
  • any OS + jdk 24 = 1899 tests
  • any OS + jdk 25 = 1899 tests

our adjustments for GH actions where platform does matter

  • windows + jdk 17 = 1899 tests
  • windows + jdk 21 = 1899 tests
  • windows + jdk 23 = 1899 tests
  • windows + jdk 24 = 1899 tests
  • windows + jdk 25 = 1899 tests

  • linux + jdk 17 = 1934 tests

  • linux + jdk 21 = 1934 tests
  • linux + jdk 23 = 1934 tests
  • linux + jdk 24 = 1934 tests
  • linux + jdk 25 = 1934 tests

  • mac + jdk 17 = 1899 tests

  • mac + jdk 21 = 1899 tests
  • mac + jdk 23 = 1899 tests
  • mac + jdk 24 = 1899 tests
  • mac + jdk 25 = 1899 tests

Extension points exported contracts — how you extend this code

Cache (Interface)
SPI for cache providers. One instance of cache will be created for each namespace. The cache implementation must [11 implementers]
src/main/java/org/apache/ibatis/cache/Cache.java
GenericInterface (Interface)
(no doc) [185 implementers]
src/test/java/org/apache/ibatis/domain/misc/generics/GenericInterface.java
SqlSource (Interface)
Represents the content of a mapped statement read from an XML file or an annotation. It creates the SQL that will be pas [13 …
src/main/java/org/apache/ibatis/mapping/SqlSource.java
WrongNamespaceMapper (Interface)
(no doc) [11 implementers]
src/test/java/org/apache/ibatis/binding/WrongNamespaceMapper.java
Invoker (Interface)
@author Clinton Begin [6 implementers]
src/main/java/org/apache/ibatis/reflection/invoker/Invoker.java
MissingNamespaceMapper (Interface)
(no doc) [11 implementers]
src/test/java/org/apache/ibatis/binding/MissingNamespaceMapper.java
ObjectWrapperFactory (Interface)
@author Clinton Begin [10 implementers]
src/main/java/org/apache/ibatis/reflection/wrapper/ObjectWrapperFactory.java
HasValue (Interface)
(no doc) [13 implementers]
src/test/java/org/apache/ibatis/submitted/enum_interface_type_handler/HasValue.java

Core symbols most depended-on inside this repo

openSession
called by 815
src/main/java/org/apache/ibatis/session/SqlSessionFactory.java
getMapper
called by 703
src/main/java/org/apache/ibatis/session/SqlSession.java
add
called by 491
src/main/java/org/apache/ibatis/reflection/wrapper/ObjectWrapper.java
get
called by 443
src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/PersonMapper.java
getName
called by 316
src/test/java/org/apache/ibatis/submitted/sptests/SPMapper.java
getResult
called by 284
src/main/java/org/apache/ibatis/type/TypeHandler.java
put
called by 281
src/main/java/org/apache/ibatis/session/Configuration.java
getConfiguration
called by 279
src/main/java/org/apache/ibatis/session/SqlSession.java

Shape

Method 7,347
Class 1,121
Interface 295
Enum 38

Languages

Java100%

Modules by API surface

src/main/java/org/apache/ibatis/session/Configuration.java149 symbols
src/test/java/org/apache/ibatis/submitted/sqlprovider/SqlProviderTest.java123 symbols
src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java67 symbols
src/test/java/org/apache/ibatis/session/SqlSessionTest.java65 symbols
src/test/java/org/apache/ibatis/domain/jpetstore/Order.java57 symbols
src/test/java/org/apache/ibatis/binding/BindingTest.java56 symbols
src/test/java/org/apache/ibatis/reflection/TypeParameterResolverTest.java55 symbols
src/main/java/org/apache/ibatis/mapping/MappedStatement.java52 symbols
src/main/java/org/apache/ibatis/jdbc/AbstractSQL.java51 symbols
src/main/java/org/apache/ibatis/datasource/pooled/PooledDataSource.java50 symbols
src/test/java/org/apache/ibatis/reflection/ReflectorTest.java47 symbols
src/test/java/org/apache/ibatis/submitted/sqlprovider/ProviderMethodResolutionTest.java46 symbols

Dependencies from manifests, versioned

cglib:cglib3.3.0 · 1×
ch.qos.logback:logback-classic1.5.15 · 1×
ch.qos.reload4j:reload4j1.2.26 · 1×
com.github.hazendaz.catch-exception:catch-exception2.3.3 · 1×
com.h2database:h22.3.232 · 1×
com.microsoft.sqlserver:mssql-jdbc
com.mysql:mysql-connector-j9.1.0 · 1×
commons-logging:commons-logging1.3.4 · 1×
net.bytebuddy:byte-buddy-agent
ognl:ognl3.4.4 · 1×
org.apache.derby:derby

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add mybatis-3 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact