├── .gitattributes ├── .github └── workflows │ ├── ci.yaml │ ├── codeql.yml │ ├── coveralls.yaml │ ├── site.yaml │ ├── sonar.yaml │ ├── sonatype.yaml │ └── support.yaml ├── .gitignore ├── .mvn ├── extensions.xml ├── maven.config ├── settings.xml └── wrapper │ ├── MavenWrapperDownloader.java │ └── maven-wrapper.properties ├── LICENSE ├── LICENSE_HEADER ├── NOTICE ├── README.md ├── format.xml ├── mvnw ├── mvnw.cmd ├── mybatis-spring-boot-autoconfigure ├── LICENSE_HEADER ├── format.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── mybatis │ │ │ └── spring │ │ │ └── boot │ │ │ └── autoconfigure │ │ │ ├── ConfigurationCustomizer.java │ │ │ ├── MybatisAutoConfiguration.java │ │ │ ├── MybatisDependsOnDatabaseInitializationDetector.java │ │ │ ├── MybatisLanguageDriverAutoConfiguration.java │ │ │ ├── MybatisProperties.java │ │ │ ├── SpringBootVFS.java │ │ │ ├── SqlSessionFactoryBeanCustomizer.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ ├── additional-spring-configuration-metadata.json │ │ ├── spring.factories │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ ├── site │ ├── markdown │ │ └── index.md │ ├── resources │ │ ├── css │ │ │ └── site.css │ │ ├── es │ │ │ └── css │ │ │ │ └── site.css │ │ ├── images │ │ │ ├── en.png │ │ │ ├── es.png │ │ │ ├── ja.png │ │ │ ├── ko.png │ │ │ └── zh.png │ │ ├── ja │ │ │ └── css │ │ │ │ └── site.css │ │ ├── ko │ │ │ └── css │ │ │ │ └── site.css │ │ └── zh_CN │ │ │ └── css │ │ │ └── site.css │ ├── site.xml │ ├── site_zh.xml │ └── zh_CN │ │ └── markdown │ │ └── index.md │ └── test │ ├── java │ ├── com │ │ └── example │ │ │ └── mapper │ │ │ └── DateTimeMapper.java │ └── org │ │ └── mybatis │ │ └── spring │ │ └── boot │ │ └── autoconfigure │ │ ├── AdditionalConfigurationMetadataTest.java │ │ ├── MybatisAutoConfigurationTest.java │ │ ├── MybatisLanguageDriverAutoConfigurationTest.java │ │ ├── MybatisPropertiesTest.java │ │ ├── TestAutoConfigurationPackage.java │ │ ├── TestAutoConfigurationPackageRegistrar.java │ │ ├── domain │ │ ├── City.java │ │ ├── Domain.java │ │ └── Name.java │ │ ├── handler │ │ ├── AtomicNumberTypeHandler.java │ │ └── DummyTypeHandler.java │ │ ├── mapper │ │ └── CityMapper.java │ │ ├── repository │ │ └── CityMapperImpl.java │ │ └── バリューオブジェクト │ │ └── シティー.java │ └── resources │ ├── db │ ├── changelog │ │ ├── db.changelog-city.yaml │ │ ├── db.changelog-master.yaml │ │ ├── db.changelog-override.json │ │ ├── db.changelog-override.sql │ │ └── db.changelog-override.xml │ └── migration │ │ └── V1__init.sql │ ├── logback-test.xml │ ├── mybatis-config-settings-only.xml │ ├── mybatis-config.xml │ ├── mybatis-config2.xml │ └── org │ └── mybatis │ └── spring │ └── boot │ └── autoconfigure │ └── repository │ └── CityMapper.xml ├── mybatis-spring-boot-samples ├── LICENSE_HEADER ├── format.xml ├── mybatis-spring-boot-sample-annotation │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── annotation │ │ │ │ ├── SampleAnnotationApplication.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── annotation │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── annotation │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-freemarker-legacy │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── freemarker │ │ │ │ └── legacy │ │ │ │ ├── SampleFreeMarkerApplication.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ ├── mappers │ │ │ ├── CityMapper-findByState.ftl │ │ │ └── CityMapper.xml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── freemarker │ │ │ └── legacy │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── freemarker │ │ └── legacy │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-freemarker │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── freemarker │ │ │ │ ├── SampleFreeMarkerApplication.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ ├── mappers │ │ │ ├── CityMapper-findByCountry.ftl │ │ │ ├── CityMapper-findByState.ftl │ │ │ └── CityMapper.xml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── freemarker │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── freemarker │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-groovy │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── groovy │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── groovy │ │ │ │ ├── SampleGroovyApplication.groovy │ │ │ │ ├── domain │ │ │ │ └── City.groovy │ │ │ │ └── mapper │ │ │ │ └── CityMapper.groovy │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ └── test │ │ └── groovy │ │ ├── extensions │ │ └── groovy │ │ │ └── CaptureSystemOutput.groovy │ │ └── sample │ │ └── mybatis │ │ └── groovy │ │ ├── SampleMybatisApplicationMainTest.groovy │ │ ├── SampleMybatisApplicationTest.groovy │ │ └── mapper │ │ ├── CityMapperTest.groovy │ │ └── MapperTestApplication.groovy ├── mybatis-spring-boot-sample-kotlin │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── kotlin │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── kotlin │ │ │ │ ├── SampleKotlinApplication.kt │ │ │ │ ├── domain │ │ │ │ └── City.kt │ │ │ │ └── mapper │ │ │ │ └── CityMapper.kt │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ └── test │ │ └── kotlin │ │ ├── extensions │ │ └── kotlin │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── kotlin │ │ ├── SampleMybatisApplicationMainTest.kt │ │ ├── SampleMybatisApplicationTest.kt │ │ └── mapper │ │ ├── CityMapperTest.kt │ │ └── MapperTestApplication.kt ├── mybatis-spring-boot-sample-thymeleaf │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── thymeleaf │ │ │ │ ├── SampleThymeleafApplication.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ ├── mappers │ │ │ ├── CityMapper-findByCountry.sql │ │ │ ├── CityMapper-findByState.sql │ │ │ └── CityMapper.xml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── thymeleaf │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── thymeleaf │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-velocity-legacy │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── velocity │ │ │ │ └── legacy │ │ │ │ ├── SampleVelocityApplication.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ ├── mappers │ │ │ ├── CityMapper-findByState.vm │ │ │ └── CityMapper.xml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── velocity │ │ │ └── legacy │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── velocity │ │ └── legacy │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-velocity │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── velocity │ │ │ │ ├── SampleVelocityApplication.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ ├── mappers │ │ │ ├── CityMapper-findByState.vm │ │ │ └── CityMapper.xml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── velocity │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── velocity │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-war │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── war │ │ │ │ ├── SampleWebApplication.java │ │ │ │ ├── controller │ │ │ │ └── CityRestController.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── sample │ │ └── mybatis │ │ └── war │ │ ├── SampleMybatisApplicationIT.java │ │ ├── SampleMybatisApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-web │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── web │ │ │ │ ├── SampleWebApplication.java │ │ │ │ ├── controller │ │ │ │ └── CityRestController.java │ │ │ │ ├── domain │ │ │ │ └── City.java │ │ │ │ └── mapper │ │ │ │ └── CityMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── sample │ │ └── mybatis │ │ └── web │ │ ├── SampleMybatisApplicationTest.java │ │ ├── SampleMybatisWithMockBeanApplicationTest.java │ │ └── mapper │ │ ├── CityMapperTest.java │ │ └── MapperTestApplication.java ├── mybatis-spring-boot-sample-xml │ ├── LICENSE_HEADER │ ├── format.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ └── mybatis │ │ │ │ └── xml │ │ │ │ ├── SampleXmlApplication.java │ │ │ │ ├── dao │ │ │ │ └── CityDao.java │ │ │ │ ├── domain │ │ │ │ ├── City.java │ │ │ │ └── Hotel.java │ │ │ │ └── mapper │ │ │ │ ├── CityMapper.java │ │ │ │ └── HotelMapper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── data.sql │ │ │ ├── mybatis-config.xml │ │ │ ├── sample │ │ │ └── mybatis │ │ │ │ └── xml │ │ │ │ └── mapper │ │ │ │ ├── CityMapper.xml │ │ │ │ └── HotelMapper.xml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ ├── extensions │ │ └── xml │ │ │ └── CaptureSystemOutput.java │ │ └── sample │ │ └── mybatis │ │ └── xml │ │ ├── SampleMybatisApplicationMainTest.java │ │ ├── SampleMybatisApplicationTest.java │ │ ├── dao │ │ ├── CityDaoTest.java │ │ └── DaoTestApplication.java │ │ └── mapper │ │ ├── HotelMapperTest.java │ │ └── MapperTestApplication.java ├── pom.xml └── run_fatjars.sh ├── mybatis-spring-boot-starter-test ├── LICENSE_HEADER ├── format.xml ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── mybatis │ └── spring │ └── boot │ └── starter │ └── test │ └── package-info.java ├── mybatis-spring-boot-starter ├── LICENSE_HEADER ├── format.xml ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── mybatis │ └── spring │ └── boot │ └── starter │ └── package-info.java ├── mybatis-spring-boot-test-autoconfigure ├── LICENSE_HEADER ├── format.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── mybatis │ │ │ └── spring │ │ │ └── boot │ │ │ └── test │ │ │ └── autoconfigure │ │ │ ├── AutoConfigureMybatis.java │ │ │ ├── MybatisTest.java │ │ │ ├── MybatisTestContextBootstrapper.java │ │ │ └── MybatisTypeExcludeFilter.java │ └── resources │ │ └── META-INF │ │ ├── spring.factories │ │ └── spring │ │ └── org.mybatis.spring.boot.test.autoconfigure.AutoConfigureMybatis.imports │ ├── site │ ├── markdown │ │ └── index.md │ ├── resources │ │ ├── css │ │ │ └── site.css │ │ ├── es │ │ │ └── css │ │ │ │ └── site.css │ │ ├── images │ │ │ ├── en.png │ │ │ ├── es.png │ │ │ ├── ja.png │ │ │ ├── ko.png │ │ │ └── zh.png │ │ ├── ja │ │ │ └── css │ │ │ │ └── site.css │ │ ├── ko │ │ │ └── css │ │ │ │ └── site.css │ │ └── zh_CN │ │ │ └── css │ │ │ └── site.css │ ├── site.xml │ ├── site_zh.xml │ └── zh_CN │ │ └── markdown │ │ └── index.md │ └── test │ ├── java │ └── org │ │ └── mybatis │ │ └── spring │ │ └── boot │ │ └── test │ │ └── autoconfigure │ │ ├── ExampleComponent.java │ │ ├── ExampleMybatisApplication.java │ │ ├── ExampleService.java │ │ ├── MybatisTestCustomFilterIntegrationTest.java │ │ ├── MybatisTestIntegrationTest.java │ │ ├── Sample.java │ │ └── SampleMapper.java │ └── resources │ └── org │ └── mybatis │ └── spring │ └── boot │ └── test │ └── autoconfigure │ ├── SampleMapper.xml │ └── schema.sql ├── pom.xml └── renovate.json /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: [workflow_dispatch, push, pull_request] 4 | 5 | permissions: read-all 6 | 7 | jobs: 8 | test: 9 | runs-on: ${{ matrix.os }} 10 | strategy: 11 | matrix: 12 | cache: [maven] 13 | distribution: [temurin] 14 | java: [17, 21, 24, 25-ea] 15 | os: [ubuntu-latest, macos-latest, windows-latest] 16 | fail-fast: false 17 | max-parallel: 4 18 | name: Test JDK ${{ matrix.java }}, ${{ matrix.os }} 19 | 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }} 23 | uses: actions/setup-java@v4 24 | with: 25 | java-version: ${{ matrix.java }} 26 | distribution: ${{ matrix.distribution }} 27 | cache: ${{ matrix.cache }} 28 | - name: Test with Maven 29 | run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" 30 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | schedule: 9 | - cron: '45 13 * * 3' 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} 15 | timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | language: [ 'java-kotlin' ] 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v4 29 | 30 | - name: Setup Java 31 | uses: actions/setup-java@v4 32 | with: 33 | cache: maven 34 | distribution: 'temurin' 35 | java-version: 21 36 | 37 | - name: Initialize CodeQL 38 | uses: github/codeql-action/init@v3 39 | with: 40 | languages: ${{ matrix.language }} 41 | queries: +security-and-quality 42 | 43 | - name: Autobuild 44 | uses: github/codeql-action/autobuild@v3 45 | 46 | - name: Perform CodeQL Analysis 47 | uses: github/codeql-action/analyze@v3 48 | with: 49 | category: "/language:${{ matrix.language }}" 50 | -------------------------------------------------------------------------------- /.github/workflows/coveralls.yaml: -------------------------------------------------------------------------------- 1 | name: Coveralls 2 | 3 | on: [push, pull_request] 4 | 5 | permissions: read-all 6 | 7 | jobs: 8 | build: 9 | if: github.repository_owner == 'mybatis' 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Set up JDK 14 | uses: actions/setup-java@v4 15 | with: 16 | cache: maven 17 | distribution: temurin 18 | java-version: 21 19 | - name: Report Coverage to Coveralls for Pull Requests 20 | if: github.event_name == 'pull_request' 21 | run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER --no-transfer-progress 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | PR_NUMBER: ${{ github.event.number }} 25 | - name: Report Coverage to Coveralls for General Push 26 | if: github.event_name == 'push' 27 | run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github --no-transfer-progress 28 | env: 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | -------------------------------------------------------------------------------- /.github/workflows/site.yaml: -------------------------------------------------------------------------------- 1 | name: Site 2 | 3 | on: 4 | push: 5 | branches: 6 | - site 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | build: 13 | if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]') 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Set up JDK 18 | uses: actions/setup-java@v4 19 | with: 20 | cache: maven 21 | distribution: temurin 22 | java-version: 21 23 | - name: Build site 24 | run: ./mvnw site site:stage -DskipTests -Dlicense.skip=true -B -V --no-transfer-progress --settings ./.mvn/settings.xml 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | NVD_API_KEY: ${{ secrets.NVD_API_KEY }} 28 | - name: Deploy Site to gh-pages 29 | uses: JamesIves/github-pages-deploy-action@v4 30 | with: 31 | branch: gh-pages 32 | folder: target/spring-boot-starter.git 33 | -------------------------------------------------------------------------------- /.github/workflows/sonar.yaml: -------------------------------------------------------------------------------- 1 | name: SonarCloud 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | permissions: read-all 9 | 10 | jobs: 11 | build: 12 | if: github.repository_owner == 'mybatis' 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | with: 17 | # Disabling shallow clone is recommended for improving relevancy of reporting 18 | fetch-depth: 0 19 | - name: Set up JDK 20 | uses: actions/setup-java@v4 21 | with: 22 | cache: maven 23 | distribution: temurin 24 | java-version: 21 25 | - name: Analyze with SonarCloud 26 | run: ./mvnw verify jacoco:report sonar:sonar -B -V -Dsonar.projectKey=mybatis_spring-boot-starter -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress 27 | env: 28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 30 | -------------------------------------------------------------------------------- /.github/workflows/sonatype.yaml: -------------------------------------------------------------------------------- 1 | name: Sonatype 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | permissions: read-all 9 | 10 | jobs: 11 | build: 12 | if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]') 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Set up JDK 17 | uses: actions/setup-java@v4 18 | with: 19 | cache: maven 20 | distribution: temurin 21 | java-version: 21 22 | - name: Deploy to Sonatype 23 | run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true 24 | env: 25 | CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} 26 | CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} 27 | -------------------------------------------------------------------------------- /.github/workflows/support.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name: Spring Boot Support Samples 18 | 19 | on: [push, pull_request] 20 | 21 | permissions: read-all 22 | 23 | jobs: 24 | test: 25 | runs-on: ${{ matrix.os }} 26 | strategy: 27 | matrix: 28 | os: [ubuntu-latest, macOS-latest, windows-latest] 29 | java: [17, 21] 30 | distribution: ['zulu'] 31 | fail-fast: false 32 | max-parallel: 5 33 | name: Test JDK ${{ matrix.java }}, ${{ matrix.os }} 34 | 35 | steps: 36 | - uses: actions/checkout@v4 37 | - name: Set up JDK 38 | uses: actions/setup-java@v4 39 | with: 40 | java-version: ${{ matrix.java }} 41 | distribution: ${{ matrix.distribution }} 42 | - name: Test with Spring Boot Latest 43 | run: | 44 | ./mvnw package 45 | ./mybatis-spring-boot-samples/run_fatjars.sh 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .settings 3 | .classpath 4 | .project 5 | *.epoch 6 | *.log 7 | *.iml 8 | .idea 9 | 10 | .factorypath 11 | .mvn/wrapper/maven-wrapper.jar 12 | *.releaseBackup 13 | release.properties 14 | .github/keys/ 15 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | fr.jcgay.maven 22 | maven-profiler 23 | 3.3 24 | 25 | 26 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5 2 | -Daether.connector.smartChecksums=false 3 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=source 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip 20 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar 21 | -------------------------------------------------------------------------------- /LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | MyBatis Spring Boot 2 | Copyright 2015-2023 3 | 4 | This product includes software developed by 5 | The MyBatis Team (https://www.mybatis.org/). 6 | -------------------------------------------------------------------------------- /format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/ConfigurationCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure; 17 | 18 | import org.apache.ibatis.session.Configuration; 19 | 20 | /** 21 | * Callback interface that can be customized a {@link Configuration} object generated on auto-configuration. 22 | * 23 | * @author Kazuki Shimizu 24 | * 25 | * @since 1.2.1 26 | */ 27 | @FunctionalInterface 28 | public interface ConfigurationCustomizer { 29 | 30 | /** 31 | * Customize the given a {@link Configuration} object. 32 | * 33 | * @param configuration 34 | * the configuration object to customize 35 | */ 36 | void customize(Configuration configuration); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/SqlSessionFactoryBeanCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure; 17 | 18 | import org.mybatis.spring.SqlSessionFactoryBean; 19 | 20 | /** 21 | * Callback interface that can be customized a {@link SqlSessionFactoryBean} object generated on auto-configuration. 22 | * 23 | * @author Kazuki Shimizu 24 | * 25 | * @since 2.2.2 26 | */ 27 | @FunctionalInterface 28 | public interface SqlSessionFactoryBeanCustomizer { 29 | 30 | /** 31 | * Customize the given a {@link SqlSessionFactoryBean} object. 32 | * 33 | * @param factoryBean 34 | * the factory bean object to customize 35 | */ 36 | void customize(SqlSessionFactoryBean factoryBean); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * @author Eddú Meléndez 18 | */ 19 | package org.mybatis.spring.boot.autoconfigure; 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": [ 3 | { 4 | "defaultValue": false, 5 | "name": "mybatis.lazy-initialization", 6 | "description": "Set whether enable lazy initialization for mapper bean.", 7 | "type": "java.lang.Boolean" 8 | }, 9 | { 10 | "defaultValue": "", 11 | "name": "mybatis.mapper-default-scope", 12 | "description": "A default scope for mapper bean that scanned by auto-configure.", 13 | "type": "java.lang.String" 14 | }, 15 | { 16 | "defaultValue": true, 17 | "name": "mybatis.inject-sql-session-on-mapper-scan", 18 | "description": "Set whether inject a SqlSessionTemplate or SqlSessionFactory bean (If you want to back to the behavior of 2.2.1 or before, specify false). If you use together with spring-native, should be set true.", 19 | "type": "java.lang.Boolean" 20 | }, 21 | { 22 | "name": "mybatis.scripting-language-driver.velocity.userdirective", 23 | "deprecation": { 24 | "level": "error", 25 | "reason": "The 'userdirective' is deprecated since Velocity 2.x. This property defined for keeping backward compatibility with older velocity version.", 26 | "replacement": "mybatis.scripting-language-driver.velocity.velocity-settings.runtime.custom_directives" 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Depends On Database Initialization Detectors 18 | org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\ 19 | org.mybatis.spring.boot.autoconfigure.MybatisDependsOnDatabaseInitializationDetector 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.mybatis.spring.boot.autoconfigure.MybatisLanguageDriverAutoConfiguration 2 | org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration 3 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/es/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-autoconfigure/src/site/resources/images/en.png -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/images/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-autoconfigure/src/site/resources/images/es.png -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/images/ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-autoconfigure/src/site/resources/images/ja.png -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/images/ko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-autoconfigure/src/site/resources/images/ko.png -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/images/zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-autoconfigure/src/site/resources/images/zh.png -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/ja/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/ko/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/resources/zh_CN/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/site/site_zh.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/com/example/mapper/DateTimeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.example.mapper; 17 | 18 | import java.time.LocalDateTime; 19 | 20 | import org.apache.ibatis.annotations.Select; 21 | 22 | public interface DateTimeMapper { 23 | 24 | @Select("SELECT current_timestamp") 25 | LocalDateTime now(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/domain/City.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure.domain; 17 | 18 | public class City implements Domain { 19 | 20 | private Long id; 21 | 22 | private String name; 23 | 24 | public Long getId() { 25 | return this.id; 26 | } 27 | 28 | public void setId(Long id) { 29 | this.id = id; 30 | } 31 | 32 | public String getName() { 33 | return this.name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/domain/Domain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure.domain; 17 | 18 | interface Domain { 19 | } 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/domain/Name.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure.domain; 17 | 18 | public class Name { 19 | 20 | private Long first; 21 | 22 | private String last; 23 | 24 | public Long getFirst() { 25 | return first; 26 | } 27 | 28 | public void setFirst(Long first) { 29 | this.first = first; 30 | } 31 | 32 | public String getLast() { 33 | return last; 34 | } 35 | 36 | public void setLast(String last) { 37 | this.last = last; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | import org.apache.ibatis.annotations.Param; 20 | import org.apache.ibatis.annotations.Select; 21 | import org.mybatis.spring.boot.autoconfigure.domain.City; 22 | 23 | @Mapper 24 | public interface CityMapper { 25 | 26 | @Select("SELECT * FROM city WHERE id = #{cityId}") 27 | City findById(@Param("cityId") Long cityId); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/repository/CityMapperImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure.repository; 17 | 18 | import org.mybatis.spring.SqlSessionTemplate; 19 | import org.mybatis.spring.boot.autoconfigure.domain.City; 20 | import org.springframework.beans.factory.annotation.Autowired; 21 | 22 | public class CityMapperImpl { 23 | 24 | @Autowired 25 | private SqlSessionTemplate sqlSessionTemplate; 26 | 27 | public City findById(long id) { 28 | return this.sqlSessionTemplate.selectOne("selectCityById", id); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/バリューオブジェクト/シティー.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.autoconfigure.バリューオブジェクト; 17 | 18 | @SuppressWarnings("unused") 19 | public class シティー { 20 | } 21 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/db/changelog/db.changelog-master.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2022 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | databaseChangeLog: 18 | - changeSet: 19 | id: 1 20 | author: marceloverdijk 21 | changes: 22 | - createTable: 23 | tableName: customer 24 | columns: 25 | - column: 26 | name: id 27 | type: int 28 | autoIncrement: true 29 | constraints: 30 | primaryKey: true 31 | nullable: false 32 | - column: 33 | name: name 34 | type: varchar(50) 35 | constraints: 36 | nullable: false 37 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/db/changelog/db.changelog-override.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2023 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | --liquibase formatted sql 18 | 19 | --changeset author:awilkinson 20 | 21 | CREATE TABLE customer ( 22 | id int AUTO_INCREMENT NOT NULL PRIMARY KEY, 23 | name varchar(50) NOT NULL 24 | ); 25 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/db/migration/V1__init.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | DROP TABLE IF EXISTS TEST; 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/mybatis-config-settings-only.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/mybatis-config2.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /mybatis-spring-boot-autoconfigure/src/test/resources/org/mybatis/spring/boot/autoconfigure/repository/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/main/java/sample/mybatis/annotation/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.annotation.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | import org.apache.ibatis.annotations.Param; 20 | import org.apache.ibatis.annotations.Select; 21 | 22 | import sample.mybatis.annotation.domain.City; 23 | 24 | /** 25 | * @author Eddú Meléndez 26 | */ 27 | @Mapper 28 | public interface CityMapper { 29 | 30 | @Select("select id, name, state, country from city where state = #{state}") 31 | City findByState(@Param("state") String state); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.annotation.mapper=TRACE 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | 21 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/test/java/sample/mybatis/annotation/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.annotation; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.annotation.CaptureSystemOutput; 23 | import extensions.annotation.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleAnnotationApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/test/java/sample/mybatis/annotation/SampleMybatisApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.annotation; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import extensions.annotation.CaptureSystemOutput; 24 | import extensions.annotation.CaptureSystemOutput.OutputCapture; 25 | 26 | /** 27 | * @author Eddú Meléndez 28 | * @author Kazuki Shimizu 29 | */ 30 | @CaptureSystemOutput 31 | @SpringBootTest 32 | class SampleMybatisApplicationTest { 33 | 34 | @Test 35 | void test(OutputCapture outputCapture) { 36 | String output = outputCapture.toString(); 37 | assertThat(output).contains("1,San Francisco,CA,US"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-annotation/src/test/java/sample/mybatis/annotation/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.annotation.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.annotation.SampleAnnotationApplication}. For more 24 | * detail information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | * 29 | * @since 1.2.1 30 | */ 31 | @SpringBootApplication 32 | public class MapperTestApplication { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/main/java/sample/mybatis/freemarker/legacy/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker.legacy.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | import org.apache.ibatis.annotations.Param; 20 | import org.apache.ibatis.annotations.Select; 21 | 22 | import sample.mybatis.freemarker.legacy.domain.City; 23 | 24 | /** 25 | * @author Kazuki Shimizu 26 | */ 27 | @Mapper 28 | public interface CityMapper { 29 | 30 | @Select("select id, name, state, country from city where id = <@p name='id'/>") 31 | City findById(@Param("id") Long id); 32 | 33 | @Select("/mappers/CityMapper-findByState.ftl") 34 | City findByState(@Param("state") String state); 35 | 36 | City findByName(@Param("name") String name); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2022 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.freemarker.legacy.mapper=TRACE 19 | 20 | mybatis.mapper-locations=classpath*:/mappers/*.xml 21 | mybatis.type-aliases-package=sample.mybatis.freemarker.legacy.domain 22 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/main/resources/mappers/CityMapper-findByState.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Copyright 2015-2022 the original author or authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | https://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | --> 18 | select 19 | id, name, state, country 20 | from 21 | city 22 | where 23 | state = <@p name="state"/> 24 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/main/resources/mappers/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/test/java/sample/mybatis/freemarker/legacy/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker.legacy; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.freemarker.legacy.CaptureSystemOutput; 23 | import extensions.freemarker.legacy.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleFreeMarkerApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/test/java/sample/mybatis/freemarker/legacy/SampleMybatisApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker.legacy; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import extensions.freemarker.legacy.CaptureSystemOutput; 24 | import extensions.freemarker.legacy.CaptureSystemOutput.OutputCapture; 25 | 26 | /** 27 | * @author Kazuki Shimizu 28 | */ 29 | @CaptureSystemOutput 30 | @SpringBootTest 31 | class SampleMybatisApplicationTest { 32 | 33 | @Test 34 | void test(OutputCapture outputCapture) { 35 | String output = outputCapture.toString(); 36 | assertThat(output).contains("1,San Francisco,CA,US"); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker-legacy/src/test/java/sample/mybatis/freemarker/legacy/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker.legacy.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.freemarker.legacy.SampleFreeMarkerApplication}. For 24 | * more detail information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | */ 29 | @SpringBootApplication 30 | public class MapperTestApplication { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.freemarker.mapper=TRACE 19 | 20 | mybatis.mapper-locations=classpath*:/mappers/*.xml 21 | mybatis.type-aliases-package=sample.mybatis.freemarker.domain 22 | 23 | mybatis.scripting-language-driver.freemarker.template-file.base-dir=mappers/ 24 | mybatis.scripting-language-driver.freemarker.template-file.path-provider.includes-package-path=false 25 | mybatis.scripting-language-driver.freemarker.template-file.path-provider.separate-directory-per-mapper=false 26 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | insert into city (name, state, country) values ('Tokyo', '13', 'JP'); 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/main/resources/mappers/CityMapper-findByCountry.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Copyright 2015-2022 the original author or authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | https://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | --> 18 | select 19 | id, name, state, country 20 | from 21 | city 22 | where 23 | country = <@p name="country"/> 24 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/main/resources/mappers/CityMapper-findByState.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Copyright 2015-2022 the original author or authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | https://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | --> 18 | select 19 | id, name, state, country 20 | from 21 | city 22 | where 23 | state = <@p name="state"/> 24 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/main/resources/mappers/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/test/java/sample/mybatis/freemarker/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.freemarker.CaptureSystemOutput; 23 | import extensions.freemarker.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleFreeMarkerApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | assertThat(output).contains("2,Tokyo,13,JP"); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/test/java/sample/mybatis/freemarker/SampleMybatisApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import extensions.freemarker.CaptureSystemOutput; 24 | import extensions.freemarker.CaptureSystemOutput.OutputCapture; 25 | 26 | /** 27 | * @author Kazuki Shimizu 28 | */ 29 | @CaptureSystemOutput 30 | @SpringBootTest 31 | class SampleMybatisApplicationTest { 32 | 33 | @Test 34 | void test(OutputCapture outputCapture) { 35 | String output = outputCapture.toString(); 36 | assertThat(output).contains("1,San Francisco,CA,US"); 37 | assertThat(output).contains("2,Tokyo,13,JP"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-freemarker/src/test/java/sample/mybatis/freemarker/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.freemarker.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.freemarker.SampleFreeMarkerApplication}. For more 24 | * detail information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | */ 29 | @SpringBootApplication 30 | public class MapperTestApplication { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/main/groovy/sample/mybatis/groovy/domain/City.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.groovy.domain 17 | 18 | class City { 19 | 20 | Long id 21 | String name 22 | String state 23 | String country 24 | 25 | @Override 26 | String toString() { 27 | return "${id},${name},${state},${country}" 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/main/groovy/sample/mybatis/groovy/mapper/CityMapper.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.groovy.mapper 17 | 18 | import org.apache.ibatis.annotations.Mapper 19 | import org.apache.ibatis.annotations.Param 20 | import org.apache.ibatis.annotations.Select 21 | 22 | import sample.mybatis.groovy.domain.City 23 | 24 | @Mapper 25 | interface CityMapper { 26 | 27 | @Select(''' 28 | select 29 | id, name, state, country 30 | from 31 | city 32 | where 33 | state = #{state} 34 | ''') 35 | City findByState(@Param("state") String state) 36 | 37 | } 38 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.groovy.mapper=TRACE 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | 21 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/test/groovy/sample/mybatis/groovy/SampleMybatisApplicationMainTest.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.groovy 17 | 18 | import org.junit.jupiter.api.Test 19 | 20 | import extensions.groovy.CaptureSystemOutput 21 | 22 | @CaptureSystemOutput 23 | class SampleMybatisApplicationMainTest { 24 | 25 | @Test 26 | void test(CaptureSystemOutput.OutputCapture outputCapture) { 27 | SampleGroovyApplication.main() 28 | def output = outputCapture.toString() 29 | assert output.contains("1,San Francisco,CA,US") 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/test/groovy/sample/mybatis/groovy/SampleMybatisApplicationTest.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.groovy 17 | 18 | import org.junit.jupiter.api.Test 19 | import org.springframework.boot.test.context.SpringBootTest 20 | 21 | import extensions.groovy.CaptureSystemOutput 22 | 23 | @CaptureSystemOutput 24 | @SpringBootTest 25 | class SampleMybatisApplicationTest { 26 | 27 | @Test 28 | void test(CaptureSystemOutput.OutputCapture outputCapture) { 29 | def output = outputCapture.toString() 30 | assert output.contains("1,San Francisco,CA,US") 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/test/groovy/sample/mybatis/groovy/mapper/CityMapperTest.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.groovy.mapper 17 | 18 | import org.junit.jupiter.api.Test 19 | import org.mybatis.spring.boot.test.autoconfigure.MybatisTest 20 | import org.springframework.beans.factory.annotation.Autowired 21 | 22 | @MybatisTest 23 | class CityMapperTest { 24 | 25 | @Autowired 26 | CityMapper cityMapper 27 | 28 | @Test 29 | void findByState() { 30 | def city = cityMapper.findByState("CA"); 31 | assert city.id == 1 32 | assert city.name == "San Francisco" 33 | assert city.state == "CA" 34 | assert city.country == "US" 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/src/test/groovy/sample/mybatis/groovy/mapper/MapperTestApplication.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.groovy.mapper 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication 19 | 20 | @SpringBootApplication 21 | class MapperTestApplication { 22 | } 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/main/kotlin/sample/mybatis/kotlin/SampleKotlinApplication.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin 17 | 18 | import org.springframework.boot.CommandLineRunner 19 | import org.springframework.boot.autoconfigure.SpringBootApplication 20 | import org.springframework.boot.runApplication 21 | import org.springframework.transaction.annotation.Transactional 22 | import sample.mybatis.kotlin.mapper.CityMapper 23 | 24 | @SpringBootApplication 25 | class SampleKotlinApplication (private val cityMapper: CityMapper) : CommandLineRunner { 26 | 27 | @Transactional 28 | override fun run(vararg args: String?) { 29 | println(this.cityMapper.findByState("CA")) 30 | } 31 | 32 | } 33 | 34 | fun main(args: Array) { 35 | runApplication(*args) 36 | } 37 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/main/kotlin/sample/mybatis/kotlin/domain/City.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin.domain 17 | 18 | data class City( 19 | var id: Long? = null, 20 | var name: String? = null, 21 | var state: String? = null, 22 | var country: String? = null 23 | ) 24 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/main/kotlin/sample/mybatis/kotlin/mapper/CityMapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin.mapper 17 | 18 | import org.apache.ibatis.annotations.Mapper 19 | import org.apache.ibatis.annotations.Param 20 | import org.apache.ibatis.annotations.Select 21 | import sample.mybatis.kotlin.domain.City 22 | 23 | @Mapper 24 | interface CityMapper { 25 | 26 | @Select(""" 27 | select 28 | id, name, state, country 29 | from 30 | city 31 | where 32 | state = #{state} 33 | """) 34 | fun findByState(@Param("state") state: String): City 35 | 36 | } 37 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2022 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.kotlin.mapper=TRACE 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/test/kotlin/sample/mybatis/kotlin/SampleMybatisApplicationMainTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin 17 | 18 | import extensions.kotlin.CaptureSystemOutput 19 | import org.assertj.core.api.Assertions.assertThat 20 | import org.junit.jupiter.api.Test 21 | 22 | @CaptureSystemOutput 23 | class SampleMybatisApplicationMainTest { 24 | 25 | @Test 26 | fun test(outputCapture: CaptureSystemOutput.OutputCapture) { 27 | main(arrayOf()) 28 | val output = outputCapture.toString() 29 | assertThat(output).contains("City(id=1, name=San Francisco, state=CA, country=US)") 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/test/kotlin/sample/mybatis/kotlin/SampleMybatisApplicationTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin 17 | 18 | import extensions.kotlin.CaptureSystemOutput 19 | import org.assertj.core.api.Assertions.assertThat 20 | import org.junit.jupiter.api.Test 21 | import org.springframework.boot.test.context.SpringBootTest 22 | 23 | @CaptureSystemOutput 24 | @SpringBootTest 25 | class SampleMybatisApplicationTest { 26 | 27 | @Test 28 | fun test(outputCapture: CaptureSystemOutput.OutputCapture) { 29 | val output = outputCapture.toString() 30 | assertThat(output).contains("City(id=1, name=San Francisco, state=CA, country=US)") 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/test/kotlin/sample/mybatis/kotlin/mapper/CityMapperTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin.mapper 17 | 18 | import org.junit.jupiter.api.Test 19 | import org.mybatis.spring.boot.test.autoconfigure.MybatisTest 20 | 21 | import org.springframework.beans.factory.annotation.Autowired 22 | 23 | import org.assertj.core.api.Assertions.assertThat 24 | 25 | @MybatisTest 26 | class CityMapperTest { 27 | 28 | @Autowired 29 | lateinit var cityMapper: CityMapper 30 | 31 | @Test 32 | fun findByState() { 33 | val city = cityMapper.findByState("CA") 34 | assertThat(city.id).isEqualTo(1) 35 | assertThat(city.name).isEqualTo("San Francisco") 36 | assertThat(city.state).isEqualTo("CA") 37 | assertThat(city.country).isEqualTo("US") 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/src/test/kotlin/sample/mybatis/kotlin/mapper/MapperTestApplication.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.kotlin.mapper 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication 19 | 20 | @SpringBootApplication 21 | class MapperTestApplication 22 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.thymeleaf.mapper=TRACE 19 | 20 | mybatis.mapper-locations=classpath*:/mappers/*.xml 21 | mybatis.type-aliases-package=sample.mybatis.thymeleaf.domain 22 | 23 | mybatis.scripting-language-driver.thymeleaf.template-file.base-dir=mappers/ 24 | mybatis.scripting-language-driver.thymeleaf.template-file.path-provider.includes-package-path=false 25 | mybatis.scripting-language-driver.thymeleaf.template-file.path-provider.separate-directory-per-mapper=false 26 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | insert into city (name, state, country) values ('Tokyo', '13', 'JP'); 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/main/resources/mappers/CityMapper-findByCountry.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2023 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | select 18 | id, name, state, country 19 | from 20 | city 21 | where 22 | country = /*[# mb:p="country"]*/ 'US' /*[/]*/ 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/main/resources/mappers/CityMapper-findByState.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2023 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | select 18 | id, name, state, country 19 | from 20 | city 21 | where 22 | state = /*[# mb:p="state"]*/ 'CA' /*[/]*/ 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/main/resources/mappers/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/test/java/sample/mybatis/thymeleaf/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.thymeleaf; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.thymeleaf.CaptureSystemOutput; 23 | import extensions.thymeleaf.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleThymeleafApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | assertThat(output).contains("2,Tokyo,13,JP"); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/test/java/sample/mybatis/thymeleaf/SampleMybatisApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.thymeleaf; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import extensions.thymeleaf.CaptureSystemOutput; 24 | import extensions.thymeleaf.CaptureSystemOutput.OutputCapture; 25 | 26 | /** 27 | * @author Kazuki Shimizu 28 | */ 29 | @CaptureSystemOutput 30 | @SpringBootTest 31 | class SampleMybatisApplicationTest { 32 | 33 | @Test 34 | void test(OutputCapture outputCapture) { 35 | String output = outputCapture.toString(); 36 | assertThat(output).contains("1,San Francisco,CA,US"); 37 | assertThat(output).contains("2,Tokyo,13,JP"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-thymeleaf/src/test/java/sample/mybatis/thymeleaf/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.thymeleaf.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.thymeleaf.SampleThymeleafApplication}. For more 24 | * detail information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | */ 29 | @SpringBootApplication 30 | public class MapperTestApplication { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2022 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.velocity.legacy.mapper=TRACE 19 | 20 | mybatis.mapper-locations=classpath*:/mappers/*.xml 21 | mybatis.type-aliases-package=sample.mybatis.velocity.legacy.domain 22 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/main/resources/mappers/CityMapper-findByState.vm: -------------------------------------------------------------------------------- 1 | #* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *# 16 | ## Does not support template file yet 17 | select 18 | id, name, state, country 19 | from 20 | city 21 | where 22 | state = @{state} 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/main/resources/mappers/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/test/java/sample/mybatis/velocity/legacy/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.velocity.legacy; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.velocity.legacy.CaptureSystemOutput; 23 | import extensions.velocity.legacy.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleVelocityApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/test/java/sample/mybatis/velocity/legacy/SampleMybatisApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.velocity.legacy; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import extensions.velocity.legacy.CaptureSystemOutput; 24 | import extensions.velocity.legacy.CaptureSystemOutput.OutputCapture; 25 | 26 | /** 27 | * @author Kazuki Shimizu 28 | */ 29 | @CaptureSystemOutput 30 | @SpringBootTest 31 | class SampleMybatisApplicationTest { 32 | 33 | @Test 34 | void test(OutputCapture outputCapture) { 35 | String output = outputCapture.toString(); 36 | assertThat(output).contains("1,San Francisco,CA,US"); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity-legacy/src/test/java/sample/mybatis/velocity/legacy/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.velocity.legacy.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.velocity.legacy.SampleVelocityApplication}. For more 24 | * detail information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | */ 29 | @SpringBootApplication 30 | public class MapperTestApplication { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2022 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=WARN 18 | logging.level.sample.mybatis.velocity.mapper=TRACE 19 | 20 | mybatis.mapper-locations=classpath*:/mappers/*.xml 21 | mybatis.type-aliases-package=sample.mybatis.velocity.domain 22 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/main/resources/mappers/CityMapper-findByState.vm: -------------------------------------------------------------------------------- 1 | #* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *# 16 | ## Does not support template file yet 17 | select 18 | id, name, state, country 19 | from 20 | city 21 | where 22 | state = @{state} 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/main/resources/mappers/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/test/java/sample/mybatis/velocity/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.velocity; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.velocity.CaptureSystemOutput; 23 | import extensions.velocity.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleVelocityApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/test/java/sample/mybatis/velocity/SampleMybatisApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.velocity; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import extensions.velocity.CaptureSystemOutput; 24 | import extensions.velocity.CaptureSystemOutput.OutputCapture; 25 | 26 | /** 27 | * @author Kazuki Shimizu 28 | */ 29 | @CaptureSystemOutput 30 | @SpringBootTest 31 | class SampleMybatisApplicationTest { 32 | 33 | @Test 34 | void test(OutputCapture outputCapture) { 35 | String output = outputCapture.toString(); 36 | assertThat(output).contains("1,San Francisco,CA,US"); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-velocity/src/test/java/sample/mybatis/velocity/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.velocity.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.velocity.SampleVelocityApplication}. For more detail 24 | * information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | */ 29 | @SpringBootApplication 30 | public class MapperTestApplication { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/main/java/sample/mybatis/war/SampleWebApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.war; 17 | 18 | import org.springframework.boot.SpringApplication; 19 | import org.springframework.boot.autoconfigure.SpringBootApplication; 20 | import org.springframework.boot.builder.SpringApplicationBuilder; 21 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 22 | 23 | @SpringBootApplication 24 | public class SampleWebApplication extends SpringBootServletInitializer { 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(SampleWebApplication.class, args); 28 | } 29 | 30 | @Override 31 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 32 | return application.sources(SampleWebApplication.class); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/main/java/sample/mybatis/war/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.war.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | import org.apache.ibatis.annotations.Param; 20 | import org.apache.ibatis.annotations.Select; 21 | 22 | import sample.mybatis.war.domain.City; 23 | 24 | /** 25 | * @author Eddú Meléndez 26 | */ 27 | @Mapper 28 | public interface CityMapper { 29 | 30 | @Select("select id, name, state, country from city where state = #{state}") 31 | City findByState(@Param("state") String state); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | server.port=18080 18 | server.servlet.context-path=/mybatis-spring-boot-sample-war 19 | 20 | logging.level.root=INFO 21 | logging.level.sample.mybatis.war.mapper=TRACE 22 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | 21 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-war/src/test/java/sample/mybatis/war/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.war.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.war.SampleWebApplication}. For more detail 24 | * information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | * 29 | * @since 1.2.1 30 | */ 31 | @SpringBootApplication 32 | public class MapperTestApplication { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/main/java/sample/mybatis/web/SampleWebApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.web; 17 | 18 | import org.springframework.boot.SpringApplication; 19 | import org.springframework.boot.autoconfigure.SpringBootApplication; 20 | 21 | @SpringBootApplication 22 | public class SampleWebApplication { 23 | 24 | public static void main(String[] args) { 25 | SpringApplication.run(SampleWebApplication.class, args); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/main/java/sample/mybatis/web/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.web.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | import org.apache.ibatis.annotations.Param; 20 | import org.apache.ibatis.annotations.Select; 21 | 22 | import sample.mybatis.web.domain.City; 23 | 24 | /** 25 | * @author Eddú Meléndez 26 | */ 27 | @Mapper 28 | public interface CityMapper { 29 | 30 | @Select("select id, name, state, country from city where state = #{state}") 31 | City findByState(@Param("state") String state); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | logging.level.root=INFO 18 | logging.level.sample.mybatis.web.mapper=TRACE 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | 19 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 20 | 21 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-web/src/test/java/sample/mybatis/web/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.web.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.web.SampleWebApplication}. For more detail 24 | * information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | * 29 | * @since 1.2.1 30 | */ 31 | @SpringBootApplication 32 | public class MapperTestApplication { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/java/sample/mybatis/xml/dao/CityDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.xml.dao; 17 | 18 | import org.apache.ibatis.session.SqlSession; 19 | import org.springframework.stereotype.Component; 20 | 21 | import sample.mybatis.xml.domain.City; 22 | 23 | /** 24 | * @author Eddú Meléndez 25 | */ 26 | @Component 27 | public class CityDao { 28 | 29 | private final SqlSession sqlSession; 30 | 31 | public CityDao(SqlSession sqlSession) { 32 | this.sqlSession = sqlSession; 33 | } 34 | 35 | public City selectCityById(long id) { 36 | return this.sqlSession.selectOne("selectCityById", id); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/java/sample/mybatis/xml/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.xml.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | import org.apache.ibatis.annotations.Param; 20 | 21 | import sample.mybatis.xml.domain.City; 22 | 23 | /** 24 | * @author Eddú Meléndez 25 | */ 26 | @Mapper 27 | public interface CityMapper { 28 | 29 | City findByState(@Param("state") String state); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/java/sample/mybatis/xml/mapper/HotelMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.xml.mapper; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | 20 | import sample.mybatis.xml.domain.Hotel; 21 | 22 | /** 23 | * @author Eduardo Macarron 24 | */ 25 | @Mapper 26 | public interface HotelMapper { 27 | 28 | Hotel selectByCityId(int cityId); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2023 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | mybatis.config-location=classpath:mybatis-config.xml 18 | logging.level.root=WARN 19 | logging.level.sample.mybatis.xml.mapper=TRACE 20 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | insert into city (name, state, country) values ('San Francisco', 'CA', 'US'); 18 | insert into hotel(city, name, address, zip) values (1, 'Conrad Treasury Place', 'William & George Streets', '4001') 19 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/resources/sample/mybatis/xml/mapper/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/resources/sample/mybatis/xml/mapper/HotelMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | drop table if exists city; 18 | drop table if exists hotel; 19 | 20 | create table city (id int primary key auto_increment, name varchar, state varchar, country varchar); 21 | create table hotel (city int, name varchar, address varchar, zip varchar); 22 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/test/java/sample/mybatis/xml/SampleMybatisApplicationMainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.xml; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | import extensions.xml.CaptureSystemOutput; 23 | import extensions.xml.CaptureSystemOutput.OutputCapture; 24 | 25 | /** 26 | * @author Kazuki Shimizu 27 | */ 28 | @CaptureSystemOutput 29 | class SampleMybatisApplicationMainTest { 30 | 31 | @Test 32 | void test(OutputCapture outputCapture) { 33 | SampleXmlApplication.main(new String[] {}); 34 | String output = outputCapture.toString(); 35 | assertThat(output).contains("1,San Francisco,CA,US"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/test/java/sample/mybatis/xml/dao/DaoTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.xml.dao; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.xml.SampleXmlApplication}. For more detail 24 | * information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | * 29 | * @since 1.2.1 30 | */ 31 | @SpringBootApplication 32 | public class DaoTestApplication { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/test/java/sample/mybatis/xml/mapper/MapperTestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package sample.mybatis.xml.mapper; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | /** 21 | * The Spring Boot Application for testing {@link org.mybatis.spring.boot.test.autoconfigure.MybatisTest @MybatisTest}. 22 | *

23 | * This class has role for prevent to run the {@link sample.mybatis.xml.SampleXmlApplication}. For more detail 24 | * information, please refer 25 | * Here. 26 | * 27 | * @author Kazuki Shimizu 28 | * 29 | * @since 1.2.1 30 | */ 31 | @SpringBootApplication 32 | public class MapperTestApplication { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-starter-test/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-starter-test/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-starter-test/src/main/java/org/mybatis/spring/boot/starter/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * MyBatis-Spring-Boot-Starter for testing. 18 | */ 19 | // This file added for generating javadoc jar and source jar file. 20 | package org.mybatis.spring.boot.starter.test; -------------------------------------------------------------------------------- /mybatis-spring-boot-starter/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-starter/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-starter/src/main/java/org/mybatis/spring/boot/starter/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * MyBatis-Spring-Boot-Starter. 18 | */ 19 | // This file added for generating javadoc jar and source jar file. 20 | package org.mybatis.spring.boot.starter; -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/LICENSE_HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${license.git.copyrightYears} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/format.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.mybatis.spring.boot.test.autoconfigure.AutoConfigureMybatis.imports: -------------------------------------------------------------------------------- 1 | # AutoConfigureMybatis auto-configuration imports 2 | org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration 3 | org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration 4 | org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration 5 | org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration 6 | org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration 7 | org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration 8 | org.springframework.boot.autoconfigure.sql.init.SqlInitializationAutoConfiguration 9 | org.mybatis.spring.boot.autoconfigure.MybatisLanguageDriverAutoConfiguration 10 | org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration 11 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/es/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-test-autoconfigure/src/site/resources/images/en.png -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/images/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-test-autoconfigure/src/site/resources/images/es.png -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/images/ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-test-autoconfigure/src/site/resources/images/ja.png -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/images/ko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-test-autoconfigure/src/site/resources/images/ko.png -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/images/zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybatis/spring-boot-starter/a2866e8cf96d585ccf742d4c99d0b55c205dbc2c/mybatis-spring-boot-test-autoconfigure/src/site/resources/images/zh.png -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/ja/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/ko/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/resources/zh_CN/css/site.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * when new flags are needed, take them from 18 | * 19 | * https://www.printableworldflags.com/flag-icon 20 | * 21 | * that are free for any kind of usage 22 | */ 23 | 24 | ul.i18n {list-style-type:none;} 25 | li.en {background: url('../../images/en.png') left no-repeat;padding-left: 32px; margin: 10px} 26 | li.es {background: url('../../images/es.png') left no-repeat;padding-left: 32px; margin: 10px} 27 | li.ja {background: url('../../images/ja.png') left no-repeat;padding-left: 32px; margin: 10px} 28 | li.zh {background: url('../../images/zh.png') left no-repeat;padding-left: 32px; margin: 10px} 29 | li.ko {background: url('../../images/ko.png') left no-repeat;padding-left: 32px; margin: 10px} 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 |

24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/site/site_zh.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/java/org/mybatis/spring/boot/test/autoconfigure/ExampleComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.test.autoconfigure; 17 | 18 | import org.springframework.stereotype.Component; 19 | 20 | /** 21 | * Example component that annotated {@link Component @Component} used with {@link MybatisTest} tests. 22 | * 23 | * @author wonwoo 24 | * 25 | * @since 1.2.1 26 | */ 27 | @Component 28 | public class ExampleComponent { 29 | 30 | public String getMessage() { 31 | return "Hello!"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/java/org/mybatis/spring/boot/test/autoconfigure/ExampleMybatisApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.test.autoconfigure; 17 | 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | import org.springframework.cache.annotation.EnableCaching; 20 | 21 | /** 22 | * Example {@link SpringBootApplication} used with {@link MybatisTest} tests. 23 | * 24 | * @author wonwoo 25 | * 26 | * @since 1.2.1 27 | */ 28 | @SpringBootApplication 29 | @EnableCaching 30 | class ExampleMybatisApplication { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/java/org/mybatis/spring/boot/test/autoconfigure/ExampleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.test.autoconfigure; 17 | 18 | import org.springframework.stereotype.Service; 19 | 20 | /** 21 | * Example component that annotated {@link Service @Service} used with {@link MybatisTest} tests. 22 | * 23 | * @author Kazuki Shimizu 24 | * 25 | * @since 1.2.1 26 | */ 27 | @Service 28 | public class ExampleService { 29 | 30 | public String getMessage() { 31 | return "Goodbye!"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/java/org/mybatis/spring/boot/test/autoconfigure/Sample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.test.autoconfigure; 17 | 18 | /** 19 | * Example entity used with {@link MybatisTest} tests. 20 | * 21 | * @author wonwoo 22 | * 23 | * @since 1.2.1 24 | */ 25 | public class Sample { 26 | 27 | private Long id; 28 | private String name; 29 | 30 | public Long getId() { 31 | return id; 32 | } 33 | 34 | public void setId(Long id) { 35 | this.id = id; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/java/org/mybatis/spring/boot/test/autoconfigure/SampleMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.spring.boot.test.autoconfigure; 17 | 18 | import org.apache.ibatis.annotations.Mapper; 19 | 20 | /** 21 | * Example mapper used with {@link MybatisTest} tests. 22 | * 23 | * @author wonwoo 24 | * 25 | * @since 1.2.1 26 | */ 27 | @Mapper 28 | public interface SampleMapper { 29 | 30 | Sample findByName(String name); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/resources/org/mybatis/spring/boot/test/autoconfigure/SampleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 26 | 27 | 30 | 31 | 32 | insert into sample values(#{id}, #{name}) 33 | 34 | 35 | -------------------------------------------------------------------------------- /mybatis-spring-boot-test-autoconfigure/src/test/resources/org/mybatis/spring/boot/test/autoconfigure/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2015-2022 the original author or authors. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); 5 | -- you may not use this file except in compliance with the License. 6 | -- You may obtain a copy of the License at 7 | -- 8 | -- https://www.apache.org/licenses/LICENSE-2.0 9 | -- 10 | -- Unless required by applicable law or agreed to in writing, software 11 | -- distributed under the License is distributed on an "AS IS" BASIS, 12 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | -- See the License for the specific language governing permissions and 14 | -- limitations under the License. 15 | -- 16 | 17 | create table sample (id int, name varchar); 18 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ] 6 | } 7 | --------------------------------------------------------------------------------