上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页
摘要: 多数据源配置实战(整合MyBatis) 首先要在@SpringBootApplication排除该类,因为它会读取application.properties文件的spring.datasource.*属性并自动配置单数据源 package com.example.multi.datasource; 阅读全文
posted @ 2022-01-13 19:24 IT6889 阅读(78) 评论(0) 推荐(0)
摘要: 限制查询 查询取前一个实体 /** * 取年龄最大 */ User findTopByOrderByAgeDesc(); 测试类 @Test public void testFindTopByOrderByAgeDesc(){ Assert.assertEquals(30,(int)userRepo 阅读全文
posted @ 2022-01-13 19:21 IT6889 阅读(155) 评论(0) 推荐(0)
摘要: 自定义高级查询 用一些加一些关键字And 、 Or 接口中定义 /** * 用户名或邮箱查询 */ List<User> findByUserNameOrEmail(String username, String email); 测试类 @Test public void testFindByUse 阅读全文
posted @ 2022-01-13 19:14 IT6889 阅读(241) 评论(0) 推荐(0)
摘要: Springboot Jpa 介绍 Spring Boot Jpa 是 Spring 基于 ORM 框架、Jpa 规范的基础上封装的一套 Jpa 应用框架,可使开发者用极简的代码即可实现对数据的访问和操作。提供了包括增删改查等在内的常用功能,且易于扩展!学习并使用 Spring Data Jpa 可 阅读全文
posted @ 2022-01-13 19:09 IT6889 阅读(134) 评论(0) 推荐(0)
摘要: 分布式系统中,Session 共享有很多的解决方案,其中托管到缓存中应该是最常用的方案之一。 共享 Session Spring Session 提供了一套创建和管理 Servlet HttpSession 的方案。Spring Session 提供了集群 Session(Clustered Ses 阅读全文
posted @ 2022-01-13 19:05 IT6889 阅读(81) 评论(0) 推荐(0)
摘要: Redis 介绍 redis 是目前使用最为广泛的内存数据存储,支持丰富的数据结构,如hashes, lists, sets 等,同时支持数据持久化。除此之外,Redis 还提供一些类数据库的特性,比如事务,HA,主从库。 Redis 在springboot中的使用 引入依赖包 <dependenc 阅读全文
posted @ 2022-01-13 19:02 IT6889 阅读(54) 评论(0) 推荐(0)
摘要: Thymeleaf 介绍 Thymeleaf 是一个跟 Velocity、FreeMarker 类似的模板引擎,它可以完全替代 JSP 。相较与其他的模板引擎,有三个优势: 可以在浏览器查看页面的静态效果,也可以在服务器查看带数据的动态页面效果。 开箱即用的特性。可以直接套用模板实现 JSTL、 O 阅读全文
posted @ 2022-01-13 18:55 IT6889 阅读(756) 评论(0) 推荐(0)
摘要: 数据库操作 pom.xml引入模块: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <depen 阅读全文
posted @ 2022-01-13 18:46 IT6889 阅读(256) 评论(0) 推荐(0)
摘要: Web 开发: 常用的 json 输出、filters、property、log等 1、Json 接口开发 使用 Spring 开发项目,需要提供 json 接口时需要做哪些配置? 添加 jackjson 等相关 jar 包 配置 Spring Controller 扫描 对接的方法添加 @Resp 阅读全文
posted @ 2022-01-13 18:38 IT6889 阅读(60) 评论(0) 推荐(0)
摘要: Spring Boot是什么 Spring Boot 是由 Pivotal 团队提供的全新框架,目的是用来简化新 Spring 应用的初始搭建以及开发过程。框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。就是 Spring Boot 其实不是什么新的框架,它默认配置了很多框架 阅读全文
posted @ 2022-01-13 17:04 IT6889 阅读(43) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页