上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: select <include refid="sqlBase" /> from goods where id = #{id} for update <!-- 可复用的sql模板 --> <sql id="sqlBase"> id,name,num </sql> 这里的表示调用id=sqlBase的复 阅读全文
posted @ 2020-10-22 09:15 DurianTRY 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: Spring Boot 集成 MyBatis 企业级应用数据持久层框架,最常见的应该是 Hibernate 和 MyBatis 。 Hibernate 是相当彻底的 ORM 对象 - 关系映射框架,使用 Hibernate ,开发者可以不考虑 SQL 语句的编写与执行,直接操作对象即可。 与 Hib 阅读全文
posted @ 2020-10-21 17:27 DurianTRY 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Spring Boot 使用 JPA JPA 就是简化 Java 持久层数据操作的技术标准,是一种方案和规范 使用 JDBC ,或者 JdbcTemplate 操作数据库,需要编写大量的 SQL 语句。SQL 语句基本都是些模板代码,实际上是可以通过分析模板代码的规则自动生成的。 使用 JPA 后, 阅读全文
posted @ 2020-10-21 16:30 DurianTRY 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Spring Boot数据源 Spring Boot 2.2.5 版本使用的默认数据源是 HikariDataSource,无需引入除JDBC、MYsq外的其他依赖。 若使用Druid数据源需要引入相关依赖 <!-- springboot druid --> <dependency> <groupI 阅读全文
posted @ 2020-10-21 15:29 DurianTRY 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Spring Boot使用jdbcTemplate 相关依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency 阅读全文
posted @ 2020-10-21 14:52 DurianTRY 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Spring Boot 跨域的实现 跨域的方法有很多种,我们此处演示一种常用的跨域方法。我们添加一个配置类,代码如下: 实例: @Configuration//配置类 public class CorsConfig { @Bean public WebMvcConfigurer corsConfig 阅读全文
posted @ 2020-10-21 11:15 DurianTRY 阅读(88) 评论(0) 推荐(0) 编辑
摘要: SpringBoot自定义配置 全文参考http://www.imooc.com/wiki/springbootlesson/conf.html Spring Boot 支持两种格式的配置文件,即 .properties 文件和 .yml 配置文件。 .properties 配置使用顿号分割语义,而 阅读全文
posted @ 2020-10-21 10:48 DurianTRY 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 使用Swagger2自动测试 目录结构 源码 pom.xml依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependenc 阅读全文
posted @ 2020-10-21 10:09 DurianTRY 阅读(848) 评论(0) 推荐(0) 编辑
摘要: 我们可以从官网新建一个helloworld项目,又或是其他项目,但无一例外都具有下面的代码块,而这就是自动装配的核心 @SpringBootApplication public class SpringBootHelloApplication { public static void main(St 阅读全文
posted @ 2020-10-20 17:16 DurianTRY 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 效果: app-module.ts 1 import { BrowserModule } from '@angular/platform-browser'; 2 import { NgModule } from '@angular/core'; 3 4 import { AppComponent } 阅读全文
posted @ 2020-10-20 10:58 DurianTRY 阅读(137) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页