Skip to content

Instantly share code, notes, and snippets.

@seanyinx
Last active May 30, 2018 01:28
Show Gist options
  • Save seanyinx/ac8bff6ac55b5055403bdcc8c1a7e191 to your computer and use it in GitHub Desktop.
Save seanyinx/ac8bff6ac55b5055403bdcc8c1a7e191 to your computer and use it in GitHub Desktop.

mybatis configuration

spring boot application.yaml

mybatis:
  config-location :  classpath:mapper/mybatis-config.xml
  mapper-locations : classpath*:mapper/*Mapper.xml,classpath*:mapper/base/*Mapper.xml

mybatis-config.xml

    <!-- print sql statement -->
    <setting name="logImpl" value="STDOUT_LOGGING"/>

mapper scan

mybatis may mistaken repository interfaces as mapper interfaces, if the base scan package is the project root package. unify mappers into the same mapper package of a multi-module project and scan the mapper package instead

@MapperScan(basePackages = {"com.xxx.infrastructure.domain"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment