diff --git a/README.md b/README.md index 5d84993..377d724 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ spring boot demo 是一个用来学习 spring boot 的项目,已经集成 actu ../spring-boot-demo-properties ../spring-boot-demo-actuator ../spring-boot-demo-logback - ../spring-boot-demo-jpa - ../spring-boot-demo-mybatis + ../spring-boot-demo-orm-jpa + ../spring-boot-demo-orm-mybatis ../spring-boot-demo-cache-redis ../spring-boot-demo-swagger ../spring-boot-demo-ureport2 @@ -133,8 +133,8 @@ spring boot demo 是一个用来学习 spring boot 的项目,已经集成 actu | [spring-boot-demo-properties](./spring-boot-demo-properties) | spring-boot 读取配置文件中的内容 | | [spring-boot-demo-actuator](./spring-boot-demo-actuator) | spring-boot 集成 spring-boot-starter-actuator 用于监控 spring-boot 的启动和运行状态 | | [spring-boot-demo-logback](./spring-boot-demo-logback) | spring-boot 集成 logback 日志 | -| [spring-boot-demo-jpa](./spring-boot-demo-jpa) | spring-boot 集成 spring-boot-starter-data-jpa 操作数据库 | -| [spring-boot-demo-mybatis](./spring-boot-demo-mybatis) | spring-boot 集成 [mybatis-spring-boot-starter](https://github.com/mybatis/spring-boot-starter)、[mybatis-spring-boot-starter](https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter) | +| [spring-boot-demo-orm-jpa](./spring-boot-demo-orm-jpa) | spring-boot 集成 spring-boot-starter-data-jpa 操作数据库 | +| [spring-boot-demo-orm-mybatis](./spring-boot-demo-orm-mybatis) | spring-boot 集成 [mybatis-spring-boot-starter](https://github.com/mybatis/spring-boot-starter)、[mybatis-spring-boot-starter](https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter) | | [spring-boot-demo-cache-redis](./spring-boot-demo-cache-redis) | spring-boot 使用 Redis 做缓存 | | [spring-boot-demo-swagger](./spring-boot-demo-swagger) | spring-boot 集成 [spring-boot-starter-swagger](https://github.com/SpringForAll/spring-boot-starter-swagger) (由大佬[翟永超](http://blog.didispace.com/)开源)用于统一管理、测试 API 接口 | | [spring-boot-demo-ureport2](./spring-boot-demo-ureport2) | spring-boot 集成 [ureport2](https://github.com/youseries/ureport) 实现自定义报表(ureport2可以轻松实现复杂的中国式报表,功能十分强大) | diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/SpringBootDemoMybatisApplication.java b/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/SpringBootDemoMybatisApplication.java deleted file mode 100644 index 6edeba6..0000000 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/SpringBootDemoMybatisApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xkcoding.springbootdemomybatis; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -@MapperScan(basePackages = {"com.xkcoding.springbootdemomybatis.mapper"}) -public class SpringBootDemoMybatisApplication { - - public static void main(String[] args) { - SpringApplication.run(SpringBootDemoMybatisApplication.class, args); - } -} diff --git a/spring-boot-demo-jpa/README.md b/spring-boot-demo-orm-jpa/README.md similarity index 95% rename from spring-boot-demo-jpa/README.md rename to spring-boot-demo-orm-jpa/README.md index c68dad4..fee571e 100644 --- a/spring-boot-demo-jpa/README.md +++ b/spring-boot-demo-orm-jpa/README.md @@ -10,11 +10,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-demo-jpa + spring-boot-demo-orm-jpa 0.0.1-SNAPSHOT jar - spring-boot-demo-jpa + spring-boot-demo-orm-jpa Demo project for Spring Boot @@ -41,7 +41,7 @@ - spring-boot-demo-jpa + spring-boot-demo-orm-jpa diff --git a/spring-boot-demo-jpa/pom.xml b/spring-boot-demo-orm-jpa/pom.xml similarity index 87% rename from spring-boot-demo-jpa/pom.xml rename to spring-boot-demo-orm-jpa/pom.xml index 142d26f..1414b6c 100644 --- a/spring-boot-demo-jpa/pom.xml +++ b/spring-boot-demo-orm-jpa/pom.xml @@ -3,11 +3,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-demo-jpa + spring-boot-demo-orm-jpa 0.0.1-SNAPSHOT jar - spring-boot-demo-jpa + spring-boot-demo-orm-jpa Demo project for Spring Boot @@ -34,7 +34,7 @@ - spring-boot-demo-jpa + spring-boot-demo-orm-jpa \ No newline at end of file diff --git a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/SpringBootDemoJpaApplication.java b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/SpringBootDemoOrmJpaApplication.java similarity index 54% rename from spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/SpringBootDemoJpaApplication.java rename to spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/SpringBootDemoOrmJpaApplication.java index 6c2cb36..88d9275 100644 --- a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/SpringBootDemoJpaApplication.java +++ b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/SpringBootDemoOrmJpaApplication.java @@ -1,12 +1,12 @@ -package com.xkcoding.springbootdemojpa; +package com.xkcoding.springbootdemoormjpa; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class SpringBootDemoJpaApplication { +public class SpringBootDemoOrmJpaApplication { public static void main(String[] args) { - SpringApplication.run(SpringBootDemoJpaApplication.class, args); + SpringApplication.run(SpringBootDemoOrmJpaApplication.class, args); } } diff --git a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/controller/JpaUserController.java b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/controller/JpaUserController.java similarity index 92% rename from spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/controller/JpaUserController.java rename to spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/controller/JpaUserController.java index 8681492..e488b16 100644 --- a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/controller/JpaUserController.java +++ b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/controller/JpaUserController.java @@ -1,8 +1,8 @@ -package com.xkcoding.springbootdemojpa.controller; +package com.xkcoding.springbootdemoormjpa.controller; import com.google.common.collect.Lists; -import com.xkcoding.springbootdemojpa.entity.JpaUser; -import com.xkcoding.springbootdemojpa.service.JpaUserService; +import com.xkcoding.springbootdemoormjpa.entity.JpaUser; +import com.xkcoding.springbootdemoormjpa.service.JpaUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; diff --git a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/entity/JpaUser.java b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/entity/JpaUser.java similarity index 87% rename from spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/entity/JpaUser.java rename to spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/entity/JpaUser.java index 836f83c..966ab88 100644 --- a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/entity/JpaUser.java +++ b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/entity/JpaUser.java @@ -1,4 +1,4 @@ -package com.xkcoding.springbootdemojpa.entity; +package com.xkcoding.springbootdemoormjpa.entity; import lombok.Data; import org.hibernate.annotations.DynamicUpdate; diff --git a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/repository/JpaUserRepository.java b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/repository/JpaUserRepository.java similarity index 83% rename from spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/repository/JpaUserRepository.java rename to spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/repository/JpaUserRepository.java index 72e5083..1d041bc 100644 --- a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/repository/JpaUserRepository.java +++ b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/repository/JpaUserRepository.java @@ -1,6 +1,6 @@ -package com.xkcoding.springbootdemojpa.repository; +package com.xkcoding.springbootdemoormjpa.repository; -import com.xkcoding.springbootdemojpa.entity.JpaUser; +import com.xkcoding.springbootdemoormjpa.entity.JpaUser; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/service/JpaUserService.java b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/service/JpaUserService.java similarity index 81% rename from spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/service/JpaUserService.java rename to spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/service/JpaUserService.java index 964ba2b..51c4af3 100644 --- a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/service/JpaUserService.java +++ b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/service/JpaUserService.java @@ -1,6 +1,6 @@ -package com.xkcoding.springbootdemojpa.service; +package com.xkcoding.springbootdemoormjpa.service; -import com.xkcoding.springbootdemojpa.entity.JpaUser; +import com.xkcoding.springbootdemoormjpa.entity.JpaUser; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/service/impl/JpaUserServiceImpl.java b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/service/impl/JpaUserServiceImpl.java similarity index 83% rename from spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/service/impl/JpaUserServiceImpl.java rename to spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/service/impl/JpaUserServiceImpl.java index 8e3508f..60748d9 100644 --- a/spring-boot-demo-jpa/src/main/java/com/xkcoding/springbootdemojpa/service/impl/JpaUserServiceImpl.java +++ b/spring-boot-demo-orm-jpa/src/main/java/com/xkcoding/springbootdemoormjpa/service/impl/JpaUserServiceImpl.java @@ -1,8 +1,8 @@ -package com.xkcoding.springbootdemojpa.service.impl; +package com.xkcoding.springbootdemoormjpa.service.impl; -import com.xkcoding.springbootdemojpa.entity.JpaUser; -import com.xkcoding.springbootdemojpa.repository.JpaUserRepository; -import com.xkcoding.springbootdemojpa.service.JpaUserService; +import com.xkcoding.springbootdemoormjpa.entity.JpaUser; +import com.xkcoding.springbootdemoormjpa.repository.JpaUserRepository; +import com.xkcoding.springbootdemoormjpa.service.JpaUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/spring-boot-demo-jpa/src/main/resources/application.yml b/spring-boot-demo-orm-jpa/src/main/resources/application.yml similarity index 100% rename from spring-boot-demo-jpa/src/main/resources/application.yml rename to spring-boot-demo-orm-jpa/src/main/resources/application.yml diff --git a/spring-boot-demo-jpa/src/test/java/com/xkcoding/springbootdemojpa/SpringBootDemoJpaApplicationTests.java b/spring-boot-demo-orm-jpa/src/test/java/com/xkcoding/springbootdemoormjpa/SpringBootDemoOrmJpaApplicationTests.java similarity index 73% rename from spring-boot-demo-jpa/src/test/java/com/xkcoding/springbootdemojpa/SpringBootDemoJpaApplicationTests.java rename to spring-boot-demo-orm-jpa/src/test/java/com/xkcoding/springbootdemoormjpa/SpringBootDemoOrmJpaApplicationTests.java index 979f482..943f38d 100644 --- a/spring-boot-demo-jpa/src/test/java/com/xkcoding/springbootdemojpa/SpringBootDemoJpaApplicationTests.java +++ b/spring-boot-demo-orm-jpa/src/test/java/com/xkcoding/springbootdemoormjpa/SpringBootDemoOrmJpaApplicationTests.java @@ -1,4 +1,4 @@ -package com.xkcoding.springbootdemojpa; +package com.xkcoding.springbootdemoormjpa; import org.junit.Test; import org.junit.runner.RunWith; @@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest -public class SpringBootDemoJpaApplicationTests { +public class SpringBootDemoOrmJpaApplicationTests { @Test public void contextLoads() { diff --git a/spring-boot-demo-mybatis/README.md b/spring-boot-demo-orm-mybatis/README.md similarity index 90% rename from spring-boot-demo-mybatis/README.md rename to spring-boot-demo-orm-mybatis/README.md index ba8578a..00104e9 100644 --- a/spring-boot-demo-mybatis/README.md +++ b/spring-boot-demo-orm-mybatis/README.md @@ -1,4 +1,4 @@ -# spring-boot-demo-mybatis +# spring-boot-demo-orm-mybatis 依赖 [spring-boot-demo-parent](../spring-boot-demo-parent)、`mybatis-spring-boot-starter`、`druid-spring-boot-starter`、`mapper-spring-boot-starter`(通用Mapper)、`pagehelper-spring-boot-starter`(分页插件PageHelper) @@ -10,11 +10,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-demo-mybatis + spring-boot-demo-orm-mybatis 0.0.1-SNAPSHOT war - spring-boot-demo-mybatis + spring-boot-demo-orm-mybatis Demo project for Spring Boot @@ -59,7 +59,7 @@ - spring-boot-demo-mybatis + spring-boot-demo-orm-mybatis @@ -122,7 +122,7 @@ spring: merge-sql: true # mybatis 配置 mybatis: - type-aliases-package: com.xkcoding.springbootdemomybatis.model + type-aliases-package: com.xkcoding.springbootdemoormmybatistis.model mapper-locations: classpath:mapper/*.xml # 配置项:开启下划线到驼峰的自动转换. 作用:将数据库字段根据驼峰规则自动注入到对象属性 configuration: @@ -131,7 +131,7 @@ mybatis: mapper: not-empty: false identity: MYSQL - mappers: com.xkcoding.springbootdemomybatis.util.MyMapper + mappers: com.xkcoding.springbootdemoormmybatistis.util.MyMapper # PageHelper 配置 pagehelper: helper-dialect: mysql @@ -164,15 +164,15 @@ INSERT INTO `mybatis_user` VALUES (1, 'klay', '13799008800', '2017-11-13 16:04:3 INSERT INTO `mybatis_user` VALUES (2, 'Tome', '18988991234', '2017-11-13 16:13:28'); ``` -### SpringBootDemoMybatisApplication.java +### SpringBootDemoOrmMybatisApplication.java ```java @SpringBootApplication -@MapperScan(basePackages = {"com.xkcoding.springbootdemomybatis.mapper"}) -public class SpringBootDemoMybatisApplication { +@MapperScan(basePackages = {"com.xkcoding.springbootdemoormmybatis.mapper"}) +public class SpringBootDemoOrmMybatisApplication { public static void main(String[] args) { - SpringApplication.run(SpringBootDemoMybatisApplication.class, args); + SpringApplication.run(SpringBootDemoOrmMybatisApplication.class, args); } } ``` @@ -223,7 +223,7 @@ public interface MybatisUserMapper extends MyMapper { ```xml - + diff --git a/spring-boot-demo-mybatis/pom.xml b/spring-boot-demo-orm-mybatis/pom.xml similarity index 91% rename from spring-boot-demo-mybatis/pom.xml rename to spring-boot-demo-orm-mybatis/pom.xml index 1bc0e61..18e093e 100644 --- a/spring-boot-demo-mybatis/pom.xml +++ b/spring-boot-demo-orm-mybatis/pom.xml @@ -3,11 +3,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-demo-mybatis + spring-boot-demo-orm-mybatis 0.0.1-SNAPSHOT war - spring-boot-demo-mybatis + spring-boot-demo-orm-mybatis Demo project for Spring Boot @@ -52,7 +52,7 @@ - spring-boot-demo-mybatis + spring-boot-demo-orm-mybatis diff --git a/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/SpringBootDemoOrmMybatisApplication.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/SpringBootDemoOrmMybatisApplication.java new file mode 100644 index 0000000..b0163dd --- /dev/null +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/SpringBootDemoOrmMybatisApplication.java @@ -0,0 +1,14 @@ +package com.xkcoding.springbootdemoormmybatis; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan(basePackages = {"com.xkcoding.springbootdemoormmybatis.mapper"}) +public class SpringBootDemoOrmMybatisApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringBootDemoOrmMybatisApplication.class, args); + } +} diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/controller/MybatisUserController.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/controller/MybatisUserController.java similarity index 91% rename from spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/controller/MybatisUserController.java rename to spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/controller/MybatisUserController.java index b0ee880..8e1aec4 100644 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/controller/MybatisUserController.java +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/controller/MybatisUserController.java @@ -1,8 +1,8 @@ -package com.xkcoding.springbootdemomybatis.controller; +package com.xkcoding.springbootdemoormmybatis.controller; import com.google.common.collect.Lists; -import com.xkcoding.springbootdemomybatis.model.MybatisUser; -import com.xkcoding.springbootdemomybatis.service.MybatisUserService; +import com.xkcoding.springbootdemoormmybatis.model.MybatisUser; +import com.xkcoding.springbootdemoormmybatis.service.MybatisUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/mapper/MybatisUserMapper.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/mapper/MybatisUserMapper.java similarity index 56% rename from spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/mapper/MybatisUserMapper.java rename to spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/mapper/MybatisUserMapper.java index cf2ee82..71bbda0 100644 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/mapper/MybatisUserMapper.java +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/mapper/MybatisUserMapper.java @@ -1,7 +1,7 @@ -package com.xkcoding.springbootdemomybatis.mapper; +package com.xkcoding.springbootdemoormmybatis.mapper; -import com.xkcoding.springbootdemomybatis.model.MybatisUser; -import com.xkcoding.springbootdemomybatis.util.MyMapper; +import com.xkcoding.springbootdemoormmybatis.model.MybatisUser; +import com.xkcoding.springbootdemoormmybatis.util.MyMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/model/MybatisUser.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/model/MybatisUser.java similarity index 89% rename from spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/model/MybatisUser.java rename to spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/model/MybatisUser.java index d0e19e0..e4c2348 100644 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/model/MybatisUser.java +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/model/MybatisUser.java @@ -1,4 +1,4 @@ -package com.xkcoding.springbootdemomybatis.model; +package com.xkcoding.springbootdemoormmybatis.model; import lombok.*; diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/service/MybatisUserService.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/service/MybatisUserService.java similarity index 77% rename from spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/service/MybatisUserService.java rename to spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/service/MybatisUserService.java index cebbd98..f78ff5f 100644 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/service/MybatisUserService.java +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/service/MybatisUserService.java @@ -1,6 +1,6 @@ -package com.xkcoding.springbootdemomybatis.service; +package com.xkcoding.springbootdemoormmybatis.service; -import com.xkcoding.springbootdemomybatis.model.MybatisUser; +import com.xkcoding.springbootdemoormmybatis.model.MybatisUser; import java.util.List; diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/service/impl/MybatisUserServiceImpl.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/service/impl/MybatisUserServiceImpl.java similarity index 83% rename from spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/service/impl/MybatisUserServiceImpl.java rename to spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/service/impl/MybatisUserServiceImpl.java index 7282e6e..a58b067 100644 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/service/impl/MybatisUserServiceImpl.java +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/service/impl/MybatisUserServiceImpl.java @@ -1,10 +1,9 @@ -package com.xkcoding.springbootdemomybatis.service.impl; +package com.xkcoding.springbootdemoormmybatis.service.impl; import com.github.pagehelper.PageHelper; -import com.xiaoleilu.hutool.util.PageUtil; -import com.xkcoding.springbootdemomybatis.mapper.MybatisUserMapper; -import com.xkcoding.springbootdemomybatis.model.MybatisUser; -import com.xkcoding.springbootdemomybatis.service.MybatisUserService; +import com.xkcoding.springbootdemoormmybatis.mapper.MybatisUserMapper; +import com.xkcoding.springbootdemoormmybatis.model.MybatisUser; +import com.xkcoding.springbootdemoormmybatis.service.MybatisUserService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/util/MyMapper.java b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/util/MyMapper.java similarity index 74% rename from spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/util/MyMapper.java rename to spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/util/MyMapper.java index c1c8cbc..7d8eaef 100644 --- a/spring-boot-demo-mybatis/src/main/java/com/xkcoding/springbootdemomybatis/util/MyMapper.java +++ b/spring-boot-demo-orm-mybatis/src/main/java/com/xkcoding/springbootdemoormmybatis/util/MyMapper.java @@ -1,4 +1,4 @@ -package com.xkcoding.springbootdemomybatis.util; +package com.xkcoding.springbootdemoormmybatis.util; import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.MySqlMapper; diff --git a/spring-boot-demo-mybatis/src/main/resources/application.yml b/spring-boot-demo-orm-mybatis/src/main/resources/application.yml similarity index 93% rename from spring-boot-demo-mybatis/src/main/resources/application.yml rename to spring-boot-demo-orm-mybatis/src/main/resources/application.yml index dc54c9c..feca12a 100644 --- a/spring-boot-demo-mybatis/src/main/resources/application.yml +++ b/spring-boot-demo-orm-mybatis/src/main/resources/application.yml @@ -52,7 +52,7 @@ spring: merge-sql: true # mybatis 配置 mybatis: - type-aliases-package: com.xkcoding.springbootdemomybatis.model + type-aliases-package: com.xkcoding.springbootdemoormmybatistis.model mapper-locations: classpath:mapper/*.xml # 配置项:开启下划线到驼峰的自动转换. 作用:将数据库字段根据驼峰规则自动注入到对象属性 configuration: @@ -61,7 +61,7 @@ mybatis: mapper: not-empty: false identity: MYSQL - mappers: com.xkcoding.springbootdemomybatis.util.MyMapper + mappers: com.xkcoding.springbootdemoormmybatistis.util.MyMapper # PageHelper 配置 pagehelper: helper-dialect: mysql diff --git a/spring-boot-demo-mybatis/src/main/resources/init-sql/schema.sql b/spring-boot-demo-orm-mybatis/src/main/resources/init-sql/schema.sql similarity index 100% rename from spring-boot-demo-mybatis/src/main/resources/init-sql/schema.sql rename to spring-boot-demo-orm-mybatis/src/main/resources/init-sql/schema.sql diff --git a/spring-boot-demo-mybatis/src/main/resources/logback-spring.xml b/spring-boot-demo-orm-mybatis/src/main/resources/logback-spring.xml similarity index 95% rename from spring-boot-demo-mybatis/src/main/resources/logback-spring.xml rename to spring-boot-demo-orm-mybatis/src/main/resources/logback-spring.xml index 1a28f34..ed14f85 100644 --- a/spring-boot-demo-mybatis/src/main/resources/logback-spring.xml +++ b/spring-boot-demo-orm-mybatis/src/main/resources/logback-spring.xml @@ -41,7 +41,7 @@ - + diff --git a/spring-boot-demo-mybatis/src/main/resources/mapper/MybatisUserMapper.xml b/spring-boot-demo-orm-mybatis/src/main/resources/mapper/MybatisUserMapper.xml similarity index 81% rename from spring-boot-demo-mybatis/src/main/resources/mapper/MybatisUserMapper.xml rename to spring-boot-demo-orm-mybatis/src/main/resources/mapper/MybatisUserMapper.xml index c8c09c5..a79ad3c 100644 --- a/spring-boot-demo-mybatis/src/main/resources/mapper/MybatisUserMapper.xml +++ b/spring-boot-demo-orm-mybatis/src/main/resources/mapper/MybatisUserMapper.xml @@ -1,7 +1,7 @@ - - + + diff --git a/spring-boot-demo-mybatis/src/test/java/com/xkcoding/springbootdemomybatis/SpringBootDemoMybatisApplicationTests.java b/spring-boot-demo-orm-mybatis/src/test/java/com/xkcoding/springbootdemoormmybatis/SpringBootDemoOrmMybatisApplicationTests.java similarity index 72% rename from spring-boot-demo-mybatis/src/test/java/com/xkcoding/springbootdemomybatis/SpringBootDemoMybatisApplicationTests.java rename to spring-boot-demo-orm-mybatis/src/test/java/com/xkcoding/springbootdemoormmybatis/SpringBootDemoOrmMybatisApplicationTests.java index df6892d..02f5ff2 100644 --- a/spring-boot-demo-mybatis/src/test/java/com/xkcoding/springbootdemomybatis/SpringBootDemoMybatisApplicationTests.java +++ b/spring-boot-demo-orm-mybatis/src/test/java/com/xkcoding/springbootdemoormmybatis/SpringBootDemoOrmMybatisApplicationTests.java @@ -1,4 +1,4 @@ -package com.xkcoding.springbootdemomybatis; +package com.xkcoding.springbootdemoormmybatis; import org.junit.Test; import org.junit.runner.RunWith; @@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest -public class SpringBootDemoMybatisApplicationTests { +public class SpringBootDemoOrmMybatisApplicationTests { @Test public void contextLoads() { diff --git a/spring-boot-demo-parent/pom.xml b/spring-boot-demo-parent/pom.xml index 43a0e9f..2333b41 100644 --- a/spring-boot-demo-parent/pom.xml +++ b/spring-boot-demo-parent/pom.xml @@ -16,8 +16,8 @@ ../spring-boot-demo-properties ../spring-boot-demo-actuator ../spring-boot-demo-logback - ../spring-boot-demo-jpa - ../spring-boot-demo-mybatis + ../spring-boot-demo-orm-jpa + ../spring-boot-demo-orm-mybatis ../spring-boot-demo-cache-redis ../spring-boot-demo-swagger ../spring-boot-demo-ureport2