SpringBoot简化了xml的配置可以快速开发,节省很多的时间,springboot的配置速度更快,SpringMvc已经不如springboot了,
市面上更多的是使用spingboot这个框架了。
springboot是springmvc的升级版,但是2者没有必然的联系。可以直接学习springboot。
微服务当下大小公司都是在用的,非常火,
spingCloud是建立在springboot的基础上的,spingcloud是为微服务打基础的。
代码上传至gitee或者github
如果写@value注解就要累死了
这种只要了解就好了 现在都是前后端分离的 不会使用这种 使用模板会对性能带来很大的损耗。 不推荐使用这种方式。
这里运行一直报错 是mysql包没有引入
spring:profiles:active: dev#active: dev pro prod(无法启动)datasource:driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/dbgirl?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8username: rootpassword: rootjpa:hibernate:ddl-auto: create
//查询一个女生 版本不一样有时候不行的
@GetMapping(value = "/girls/{id}")
public Girl girlFindOne(@PathVariable("id") Integer id){return girlRepository.findById(id).get();
}
照着做没做出了 事务这里 也不知道为什么 ??? 有空问问胡玉海
找到原因了是 数据库不支持事务MyIsam 修改为InnoDB就可以了
代码别忘了推送github上去!!!!!!!!!!!!
https://github.com/yangjiabinylg/girl 推送成功了 在github上面了
alter table girl type=InnoDB --没用
CREATE TABLE `girl` (
`id` int(11) NOT NULL,
`age` int(11) DEFAULT NULL,
`cup_size` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
[SQL]CREATE TABLE `girl`(
`id` int(11) NOT NULL,
`age` int(11) DEFAULT NULL,
`cup_size` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
受影响的行: 0
时间: 1.166s
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by