随笔分类 -  spring boot

摘要:pojo: 保存示例: 查询示例: 阅读全文
posted @ 2019-04-01 19:58 hcss 阅读(493) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/u011781521/article/details/72210980 JPA提供的四种标准用法为TABLE,SEQUENCE,IDENTITY,AUTO. TABLE:使用一个特定的数据库表格来保存主键。 SEQUENCE:根据底层数据库的序列来生成主键 阅读全文
posted @ 2019-03-28 00:01 hcss 阅读(47182) 评论(0) 推荐(8)
摘要:Repository接口 提供了按方法名称的查询方式; 提供了@Query的查询方式 可能遇到的错误: 1)Caused by: javax.persistence.TransactionRequiredException: Executing an update/delete query(手动加@ 阅读全文
posted @ 2019-03-23 00:29 hcss 阅读(589) 评论(0) 推荐(0)
摘要:org.springframework.boot spring-boot-starter-thymeleaf org.springframework.boot spring-boot-starter-web ... 阅读全文
posted @ 2019-03-22 18:13 hcss 阅读(152) 评论(0) 推荐(0)
摘要:添加配置类,初始化RedisTemplate 测试类 阅读全文
posted @ 2019-03-20 23:40 hcss 阅读(239) 评论(0) 推荐(0)
摘要:cd redis-3.0.0/ make:编译。(提示没有权限,所以要修改/etc/sudoers文件,该文件是只读的,所以要用visudo -f /etc/sudoers编辑,yy是复制整行,p是粘贴,dd是剪切整行,esc是命令模式,i是插入模式。) make PREFIX=/user/loca 阅读全文
posted @ 2019-03-16 00:53 hcss 阅读(111) 评论(0) 推荐(0)
摘要:@Cacheable的使用 @CacheEvict:清除缓存 阅读全文
posted @ 2019-03-15 21:30 hcss 阅读(130) 评论(0) 推荐(0)
摘要:package com.example.zs; import com.example.zs.mapper.UserMapper; import com.example.zs.pojo.User; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.ann... 阅读全文
posted @ 2019-03-15 15:53 hcss 阅读(235) 评论(0) 推荐(0)
摘要:异常流程 :controller-ControllerAdvice-异常解析器-默认的error页面 1.错误页面error.html: 程序出现异常会自动跳到error.html里,视频效果,该页面可以使用th:text="${exception}"显示异常信息,但自己测试时,页面成功显示,但异常 阅读全文
posted @ 2019-03-14 19:52 hcss 阅读(1437) 评论(0) 推荐(0)
摘要:1.实体类属性上添加注解规则 如 阅读全文
posted @ 2019-03-14 01:13 hcss 阅读(804) 评论(0) 推荐(0)
摘要:<font color="red" th:text="开始了">font外</font>页面显示红色字体 开始了 (同时存在,则前者覆盖了后者,总的来说是以前者为准) <font color="red" >font外</font> 页面显示红色字体 font外 <font color="red" t 阅读全文
posted @ 2019-03-14 00:36 hcss 阅读(823) 评论(0) 推荐(0)
摘要:数据库配置如下 项目结构图 遇到的错误:invalid bound statement (not found) --mapper文件没有配置。 注解点 阅读全文
posted @ 2019-03-12 18:12 hcss 阅读(186) 评论(0) 推荐(0)
摘要:绝对路径格式:th:href="@{http://www.baidu.com}" 阅读全文
posted @ 2019-03-11 23:18 hcss 阅读(225) 评论(0) 推荐(0)
摘要:遍历 list如下 th:each th:each 状态变量 var 遍历map如下(需要双层遍历) controller代码如下 阅读全文
posted @ 2019-03-11 20:12 hcss 阅读(972) 评论(0) 推荐(0)
摘要:th:if th:switch 阅读全文
posted @ 2019-03-11 19:48 hcss 阅读(212) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-03-11 19:43 hcss 阅读(345) 评论(0) 推荐(0)
摘要:回到idea正常界面,Mac使用快捷键shift+option+command+/,window上的快捷键是Shift+Ctrl+Alt+/,打开Registry,勾选 compiler.automake.allow.when.app.runningcompiler.automake.allow.w 阅读全文
posted @ 2019-03-11 04:24 hcss 阅读(135) 评论(0) 推荐(0)
摘要:以下是一些小测试 阅读全文
posted @ 2019-03-11 00:45 hcss 阅读(216) 评论(0) 推荐(0)
摘要:例如meta标签,低版本标签必须要闭合,高版本不用这么严格。 pom文件引入高版本jar包如下,propertis里添加: 阅读全文
posted @ 2019-03-10 21:27 hcss 阅读(91) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-03-10 18:56 hcss 阅读(89) 评论(0) 推荐(0)