11 2022 档案
摘要:1.数据的更新 1.1 goods.xml <update id="update" parameterType="com.imooc.mybatis.entity.Goods"> UPDATE t_goods SET title = #{title} , sub_title = #{subTitle
阅读全文
摘要:1.selectKey的用法 2.useGeneratedKeys的用法 3.测试实例 4.selectKey与useGeneratedKeys的区别 4.1显示与隐示 4.2 应用场景 4.3在Oracle中使用selectKey 5.总结
阅读全文
摘要:1.applicationContext.xml <bean id="andy" class="com.imooc.spring.ioc.entity.Child"> <constructor-arg name="name" value="安迪"/> <constructor-arg name="a
阅读全文
摘要:1.数据库事务 2.新增 3.实现步骤 3.1 goods.xml 在插入的时候没有插入主键是因为主键设置成了自增字段,<selectKey >的作用是进行主键回填 <insert id="insert" parameterType="com.imooc.mybatis.entity.Goods"
阅读全文
摘要:1.ResultMap结果映射 2.利用java对象保存保存多表关联结果 2.1 创建GoodsDTOd.java,用于对原始数据进行扩展,用于数据保存和传递(src/main/java/com/imooc/mybatis/dto) 2.2 goods.xml 2.3 测试类 2.4 对上述案列进行
阅读全文
摘要:1.对象依赖注入 2.利用setter实现静态数值的注入 2.1 pom.xml <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.2.6.RE
阅读全文
摘要:1.加载单个配置文件 2.加载多个配置文件 3.路径表达式的书写方法
阅读全文
摘要:1.形式 2. 单参数传递,使用parameterType指定参数的数据类型即可,SQL中#{value}提取参数parameterType="Integer" 2.1 goods.xml <!-- 单参数传递,使用parameterType指定参数的数据类型即可,SQL中#{value}提取参数-
阅读全文
摘要:1.MyBatis数据查询步骤 1.1 创建实体类entity 1.2 创建mapper xml文件来说明当前sql语句是什么并编写<select > sql语句 1.3 在mybatis-config.xml开启驼峰映射 1.4 在mybatis-config.xml新增mapper xml的声明
阅读全文
摘要:1.什么是SqlSessionFactory 2. src/main/java/com/imooc/mybatis/utils/MyBatisUtils.java package com.imooc.mybatis.utils; import org.apache.ibatis.io.Resourc
阅读全文
摘要:1. pom.xml <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.11</version> </dependency> <dependency> <groupId>
阅读全文
摘要:1.JUnit4使用方法 2. pom.xml <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> 3.测试命名规则
阅读全文
摘要:1.什么是Mybatis 2.Mybatis开发流程
阅读全文
摘要:1.软件开发中的框架 2.框架的优点 3.SSM框架
阅读全文
摘要:1.从IoC容器获取Bean 2. src/main/java/com/imooc/spring/ioc/SpringApplication.java package com.imooc.spring.ioc; import com.imooc.spring.ioc.entity.Apple; im
阅读全文
摘要:1. 工厂实例方法创建对象是指Ioc容器对工厂类进行实例化,并调用对应的实例方法创建对象的过程 2. src/main/java/com/imooc/spring/ioc/factory/AppleFactoryInstance.java package com.imooc.spring.ioc.f
阅读全文
摘要:1.工厂模式就是指隐藏创建类的细节,通过一个额外的工厂类来组织创建我们需要的对象,工厂按表现形式又分为静态工厂和工厂实例 2. src/main/java/com/imooc/spring/ioc/factory/AppleStaticFactory.java 苹果的静态工厂 package com
阅读全文
摘要:1.实例化bean的三种方式 2.初始化Ioc容器 2.1 利用构造方法参数名实例化 2.2 利用构造方法参数位置实例化 2.3 实现步骤 2.3.1 src/main/java/com/imooc/spring/ioc/entity/Apple.java package com.imooc.spr
阅读全文
摘要:1.src/main/resources(applicationContext.xml) <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:x
阅读全文
摘要:1.application.xml 2.Xml方式创建Ioc容器 3.Spring框架组成模块
阅读全文
摘要:1.创建实体类 package com.imooc.entity; public class Apple { private String title; private String color; private String origin; public Apple() { } public Ap
阅读全文
摘要:1.Ioc控制反转是一种设计理念 2.举例 3.DI依赖注入
阅读全文
摘要:1.login.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>慕课网OA办公系统</title> <!-- 引入样式 --> <link rel="stylesheet" type="text/c
阅读全文
摘要:1. com.imooc.oa.controller创建servlet package com.imooc.oa.controller; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson
阅读全文
摘要:1.编译安装应用程序 2.yum与编译安装的区别 3.编译安装redis 3.1 上传 redis-4.0.14.tar.gz (/usr/local) 3.2 tar -zxvf redis-4.0.14.tar.gz 3.3 [root@imooc redis-4.0.14]# yum inst
阅读全文
摘要:1.创建实体类(entity下) package com.imooc.oa.entity; public class User { private Long userId; //user_id private String username; private String password; pri
阅读全文
摘要:1.缓存清除策略中的参数详解 <!--开启了二级缓存 eviction是缓存的清除策略,当缓存对象数量达到上限后,自动触发对应算法对缓存对象清除 1.LRU – 最近最久未使用:移除最长时间不被使用的对象。 O1 O2 O3 O4 .. O512 14 99 83 1 893 2.FIFO – 先进
阅读全文
摘要:1.Mybatis的二级缓存 2.怎样开启Mybatis的二级缓存 3.怎样开启Mybatis的二级缓存 3.1 在MybatisTest.java中测试一级缓存 /** * 测试一级缓存 * @throws Exception */ @Test public void testLv1Cache()
阅读全文
摘要:1.什么是动态SQL 2.在pom.xml中添加 <select id="dynamicSQL" parameterType="java.util.Map" resultType="com.imooc.mybatis.entity.Goods"> select * from t_goods <whe
阅读全文
摘要:1.SLF4j与Logback 2.自定义使用logback日志 2.1 pom.xml <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</v
阅读全文
摘要:1.Sql注入是什么 2.俩种传值方式 3.相关语句(高级查询必须要进行sql拼接时用$,如${order},但绝对不能让用户从前台输入) <select id="selectByTitle" parameterType="java.util.Map" resultType="com.imooc.m
阅读全文
摘要:1.更新 1.1 在goods.xml中编写 <update id="update" parameterType="com.imooc.mybatis.entity.Goods"> UPDATE t_goods SET title = #{title}, sub_title = #{subTitle
阅读全文
摘要:1.selectKey与useGeneratedKeys的区别 2.代码示例 <!--selectKey与useGeneratedKeys的区别--> <!--selectKey用法--> <!--<insert id="insert" parameterType="com.imooc.mybati
阅读全文
摘要:1.配置文件 <?xml version="1.0" encoding="UTF-8"?> <!--日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL --> <!--Configuration后面的status,
阅读全文
摘要:1.引入log4j2.xml(src/main/resources/log4j2.xml) <?xml version="1.0" encoding="UTF-8"?> <Configuration status="fatal"> <Properties> <!--放到服务器上value需要自己替换
阅读全文
摘要:1.Linux压缩程序 gzip 2.tar打包与压缩 2.1 tar相关命令
阅读全文
摘要:1.配置数据库application.properties spring.datasource.name=imooc_mall_datasource spring.datasource.url=jdbc:mysql://127.0.0.1:3306/imooc_mall?useUnicode=tru
阅读全文
摘要:1.整合Mybatis 1.1 在pom.xml中添加文件 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.
阅读全文
摘要:1.引入依赖 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.1</version> </depende
阅读全文
摘要:1.种配置文件区分 2.格式转化的网站 3.使用(application.properties中编写) 3.1 配置端口号、项目名字、公共前缀 server.port=8081 spring.application.name=first-spring-boot server.servlet.cont
阅读全文
摘要:1.Get方式对参数的处理(@RequestParam) /** * 描述: 演示接口和传参 * //@RestController 表示返回时JSON格式不是页面 */ @RestController public class ParaController { /** * //@RequestPa
阅读全文
摘要:1.开发firstrequest接口 /** * 描述: 演示接口和传参 * //@RestController 表示返回时JSON格式不是页面 */ @RestController public class ParaController { @GetMapping("/firstrequest")
阅读全文
摘要:1.常用文本工具 1.1 echo举列 1.1.1 向屏幕输出 1.1.2 单个大于号代表的是重写的意思,俩个大于号是追加的意思, 1.2 cat 查看文件内容 1.2.1 查看文件内容(可以增加 -n、E) 1.2.2 合并文件 (将hello.txt和myname.txt文件合并到full.tx
阅读全文
摘要:1.关于Vim的介绍 2.关于Vim的三种模式 3.Vim常用快捷键 4.例子 4.1 将80端口调整为8900端口(不是文本中的8080端口)
阅读全文
摘要:1.Mybatis数据写操作操作 2.步骤 2.1 在good.xml中添加SQL语句 <insert id="insert" parameterType="com.imooc.mybatis.entity.Goods" > INSERT INTO t_goods(title, sub_title,
阅读全文
摘要:1.对ResultMap结果映射的理解 2.流程操作 2.1 在good.xml中编辑代码(利用Map接收关联查询结果) <!-- 利用LinkedHashMap保存多表关联结果 MyBatis会将每一条记录包装为LinkedHashMap对象 key是字段名 value是字段对应的值 , 字段类型
阅读全文
摘要:1.在pom.xml中添加依赖 <!--Druid数据库连接池--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.2.14</version> </dependency>
阅读全文
摘要:1.在good.xml中编辑sql语句(单参数) <!-- 单参数传递,使用parameterType指定参数的数据类型即可,SQL中#{value}提取参数--><select id="selectById" parameterType="Integer" resultType="com.imoo
阅读全文
摘要:1.Java编译器对String做了特殊处理,虽然可以直接拼接字符串,但是,在循环中,每次循环都会创建新的字符串对象,然后扔掉旧的字符串。这样,绝大部分字符串都是临时对象,不但浪费内存,还会影响GC效率。为了能高效拼接字符串,Java标准库提供了StringBuilder,它是一个可变对象,可以预分
阅读全文
摘要:1.Mybatis数据查询步骤 2.在mappers映射器下创建文件(src/main/resources/mappers/goods.xml) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.or
阅读全文
摘要:1.MyBatisUtils工具类,创建全局唯一的SqlSessionFactory对象(src/main/java/com/imooc/mybatis/utils/MyBatisUtils.java) package com.imooc.mybatis.utils; import org.apac
阅读全文
摘要:1.在pom.xml文件中引入依赖 <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> 2.创建MybatisTest.java测试Ses
阅读全文
摘要:1.在Mybatis的pom.xml文件中添加依赖 <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.11</version> </dependency> <depend
阅读全文

浙公网安备 33010602011771号