Skip to content

Conversation

@taole33
Copy link
Contributor

@taole33 taole33 commented Nov 29, 2025

Title: docs: Add complete Java Config examples for SqlSessionFactoryBean


Summary

This Pull Request addresses the issue where the programmatic configuration examples for SqlSessionFactoryBean were missing in the documentation (Issue #502).

It replaces fragmented code snippets with complete, ready-to-use @Configuration class examples, including how to set mapperLocations and the MyBatis Configuration instance directly in Java.

Changes Details

  1. Added Java Config equivalents for all XML examples in the 'Properties' section (mapperLocations, Configuration property).
  2. Added a full, cohesive MyBatisConfig class example at the end of the chapter.
  3. Ensured the code includes throws Exception for compiler correctness.

…#502)

Add complete Java Configuration examples (using @bean methods) for SqlSessionFactoryBean properties, including mapperLocations and Configuration instance settings.

This resolves the lack of programmatic configuration documentation requested in mybatis#502.
@coveralls
Copy link

Coverage Status

coverage: 90.242%. remained the same
when pulling c77daf0 on taole33:fix/issue-502-java-config-doc
into 65cc15a on mybatis:master.

@kazuki43zoo kazuki43zoo added the backport to other version Backport to other maintenance version label Nov 30, 2025
@kazuki43zoo kazuki43zoo added this to the 4.0.0 milestone Nov 30, 2025
@kazuki43zoo kazuki43zoo merged commit a498abf into mybatis:master Nov 30, 2025
16 checks passed
@kazuki43zoo kazuki43zoo removed the backport to other version Backport to other maintenance version label Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants