spring-data-jpa中findById()的使用
摘要:springboot 2.x 版本后,较之前的版本在此方法的使用上有差: 如果找到匹配的id数据,则赋值给foo;否则则将括号中的对象赋值给foo。
阅读全文
posted @
2019-08-22 16:15
kongieg
阅读(12905)
推荐(2) 编辑
Caused by: java.sql.SQLSyntaxErrorException: Table 'sell.hibernate_sequence' doesn't exist
摘要:数据表: domain: Repository: 测试代码: 报错:Caused by: java.sql.SQLSyntaxErrorException: Table 'sell.hibernate_sequence' doesn't exist 解决:在domain实体类指明主键生成策略,保持数
阅读全文
posted @
2019-08-20 10:18
kongieg
阅读(3239)
推荐(0) 编辑
正则
摘要:字面量 var reg = / \bis\b /g; 匹配语句中为is的单词,g表示为全文匹配 eg: 'This is a boy.That is a dog'.replace(reg,'IS'); 构造函数 var reg = new RegExp('\\bis\\b','g'); eg: 'T
阅读全文
posted @
2019-08-14 10:41
kongieg
阅读(184)
推荐(0) 编辑
could not autowired.no beans of ' ' type found
摘要:在service实现类对dao层的mapper进行装配时显示未发现bean! 解决方法:在dao层的 *mapper接口上添加@Repository注解
阅读全文
posted @
2019-08-08 15:50
kongieg
阅读(2040)
推荐(0) 编辑
Thymeleaf遍历list和map
摘要:遍历list: Controller: html: 遍历Map: html:
阅读全文
posted @
2019-08-08 13:14
kongieg
阅读(15259)
推荐(3) 编辑
spring-boot访问不到jsp
摘要:首先在application.properties中设置好访问界面的前后缀 在src | main 新建文件夹webapp,在webapp中新建WEB-INF | jsp文件夹,在jsp文件夹中新建*.jsp文件. 项目目录结构: controller类: 此时可尝试在浏览器中进行访问:localh
阅读全文
posted @
2019-08-07 16:58
kongieg
阅读(1348)
推荐(1) 编辑