SpringBoot集成mybatis,同时读取一个数据库中多个数据表
SpringBoot集成mybatis,同时读取一个数据库中多个数据表:
application.properties:
mybatis.config-location=classpath:mybatis/mybatis-config.xml
mybatis.mapper-locations=classpath:mybatis/mapper/PointMapper.xml,mybatis/mapper/LineMapper.xml
mybatis.type-aliases-package=com.example.demo.domain
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/your databasename?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=password
其余不变。