摘要: spring boot 整合spring Data JPA 页面 yaml 做测试或者项目之前先捋一遍思路在下手,这样出错可以迅速查找到哪一步代码出错 1.1 需求 :查询数据库 》数据 》展示到页面上 1.2 分析 1 创建数据库 user表 2 持久层框架 spring data jpa 3 j 阅读全文
posted @ 2019-11-05 22:24 互联网蜜蜂 阅读(1434) 评论(0) 推荐(1) 编辑
摘要: 引言: 在相当长的一段时间内,实现应用程序的数据访问层一直很麻烦。 必须编写太多样板代码来执行简单查询以及执行分页和审计。 Spring Data JPA旨在通过减少实际需要的工作量来显著改善数据访问层的实现。 作为开发人员,您编写repository接口,包括自定义查找器方法,Spring将自动提 阅读全文
posted @ 2019-11-05 22:21 互联网蜜蜂 阅读(243) 评论(0) 推荐(1) 编辑
摘要: 一. spring boot 整合mybatis 1.整合思路: 1.1 添加依赖 mybatis 1.2 在配置文件中配置数据源信息 1.3 编写pojo mapper接口 mapeer映射文件 1.4手动配置mybatis的包扫描,在主启动类添加@MapperScan 1.5 启动springb 阅读全文
posted @ 2019-11-05 22:04 互联网蜜蜂 阅读(3966) 评论(0) 推荐(0) 编辑
摘要: spring的配置资源(包含mybatis): <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org 阅读全文
posted @ 2019-11-05 22:01 互联网蜜蜂 阅读(263) 评论(0) 推荐(0) 编辑
摘要: <dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.7.0</version></dependency><dependency><groupId>io.spr 阅读全文
posted @ 2019-11-05 15:32 互联网蜜蜂 阅读(1364) 评论(0) 推荐(0) 编辑
摘要: DROP TABLE IF EXISTS `user`;CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) DEFAULT NULL, `password` varchar(50) DE 阅读全文
posted @ 2019-11-05 14:40 互联网蜜蜂 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi: 阅读全文
posted @ 2019-11-05 14:38 互联网蜜蜂 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1.SpringBoot json支持 1.1创建实体bean Car Lombok使用: 1、导入依赖库 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18. 阅读全文
posted @ 2019-11-05 00:26 互联网蜜蜂 阅读(255) 评论(0) 推荐(0) 编辑