SpringBoot
springboot, springdatajpa
小小少年eason
这个作者很懒,什么都没留下…
展开
-
springboot 日志按照年月日保存
在resouces添加文件logback-spring.xml<?xml version="1.0" encoding="UTF-8"?><configuration> <include resource="org/springframework/boot/logging/logback/defaults.xml" /> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppe原创 2021-02-25 10:25:35 · 641 阅读 · 0 评论 -
springboot + vue 部署服务器
文章目录第一步 vue打包第二步 将dist内容导入spring boot中第三步 打包jar第四步 启动服务一开始我们有2个项目, 一个springboot , 一个vue第一步 vue打包第二步 将dist内容导入spring boot中先在springboot 项目的 src/main/java/resources 中创建一个static文件夹, 再将dist中的内容复制到static中第三步 打包jar第四步 启动服务就可以了...原创 2021-02-05 14:00:18 · 126 阅读 · 0 评论 -
spring data jpa 模糊查询like 坑点
在 ServiceImpl 中 调用, 不要忘记 %factoryinfoDao.findByFactorynameLike("%"+input+"%")原创 2021-01-26 16:52:37 · 412 阅读 · 0 评论 -
vue + springboot 实现下载功能
前端直接下载txt文件而不是打开它后端spring-boot返回文件流原创 2021-01-25 11:46:51 · 196 阅读 · 0 评论 -
spring data jpa 循环插入数据库报错 A different object with the same identifier value was already associated w
A different object with the same identifier value was already associated with the session@Id@Column(name = "id")@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;在主码上加上IDENTITY:主键由数据库自动生成(主要是自动增长型)...原创 2021-01-21 14:53:26 · 801 阅读 · 0 评论 -
springboot + elementui 实现分页功能
目录后端前端后端// num为当前页 size为每页个数 public Page<codesection> pageAll(int num, int size) { //第一部分 实现分页查询 Pageable pageable = PageRequest.of(num,size); Page<codesection> codesections = codesectionDao.findAll(pageable);原创 2021-01-20 16:04:05 · 690 阅读 · 0 评论 -
使用BeanUtils.copyProperties进行对象之间属性的赋值
使用org.springframework.beans.BeanUtils.copyProperties方法进行对象之间属性的赋值,避免通过get、set方法一个一个属性的赋值@PostMapping("/register") public Object register(@RequestBody User user){ Map<String, Object> map = new HashMap<>(); if(userRepository.原创 2020-07-10 17:16:07 · 339 阅读 · 0 评论 -
springboot 时区
在application.properties添加spring.jackson.time-zone=GMT+8原创 2020-07-09 23:03:08 · 172 阅读 · 0 评论 -
springboot get方法带参数
@GetMapping("/allWeiboListByUserid") public Object getAllWeiboListByUserid(@RequestParam Integer userId){ }http://localhost:8082/allWeiboListByUserid?userId=1原创 2020-07-09 22:16:34 · 982 阅读 · 0 评论 -
springboot @CreationTimestamp 自动生成时间戳
@CreationTimestamp @Column(name="message_time") private Timestamp messageTime;原创 2020-07-09 21:52:56 · 5066 阅读 · 0 评论 -
Mybatis There is no getter for property报错和解决
文章目录报错时间报错场景报错代码和错误信息报错原因解决方法报错时间2020年4月24日11:28:02报错场景使用Mybatis向MySQL数据库添加数据报错代码和错误信息org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ibatis.r...原创 2020-04-24 11:31:53 · 549 阅读 · 0 评论 -
springboot项目 o.s.b.d.LoggingFailureAnalysisReporter 错误解决方法
文章目录报错时间报错场景报错代码和错误信息报错原因解决方法参考资料报错时间2020年4月9日21:04:32报错场景创建springboot后启动application报错报错代码和错误信息ERROR 17824 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter报错原因这是因为spring boot 会默认加...原创 2020-04-09 21:09:39 · 43044 阅读 · 6 评论