04 2020 档案

摘要:结果集映射 元素是 MyBatis 中最重要最强大的元素 的设计思想是,对于简单的语句根本不需要配置显式的结果映射,而对于复杂一点的语句只需要描述它们的关系就行了。 最优秀的地方在于,虽然你已经对它相当了解了,但是根本就不需要显式地用到他们。 如果世界总是这么简单就好了。 阅读全文
posted @ 2020-04-27 22:22 xl4ng 阅读(103) 评论(0) 推荐(0) 编辑
摘要:MapperRegistry:注册绑定我们的Mapper文件; 方式一: 【推荐使用】 方式二:使用class文件绑定注册 注意点: 接口和他的Mapper配置文件必须同名! 接口和他的Mapper配置文件必须在同一个包下! 方式三:使用扫描包进行注入绑定 注意点: 接口和他的Mapper配置文件必 阅读全文
posted @ 2020-04-27 21:44 xl4ng 阅读(134) 评论(0) 推荐(0) 编辑
摘要:类型别名是为 Java 类型设置一个短的名字。‘ 存在的意义仅在于用来减少类完全限定名的冗余。 也可以指定一个包名,MyBatis 会在包名下面搜索需要的 Java Bean,比如: 扫描实体类的包,它的默认别名就为这个类的 类名,首字母小写! 在实体类比较少的时候,使用第一种方式。 如果实体类十分 阅读全文
posted @ 2020-04-27 21:26 xl4ng 阅读(244) 评论(0) 推荐(0) 编辑
摘要:创建数据库配置文件(db.properties) 引入配置文件以及使用内部属性配置 阅读全文
posted @ 2020-04-27 21:10 xl4ng 阅读(198) 评论(0) 推荐(0) 编辑
摘要:导入引用并设置构建目录 创建Mybatis核心配置文件(mybatis config.xml) 创建Mybatis工具类(MybatisUtils.java) 创建实体类 创建UserMapper接口 创建UserMapper.xml 阅读全文
posted @ 2020-04-26 22:53 xl4ng 阅读(133) 评论(0) 推荐(0) 编辑
摘要:泛型类 泛型方法 类型变量的限定 阅读全文
posted @ 2020-04-18 13:29 xl4ng 阅读(145) 评论(0) 推荐(0) 编辑
摘要:```package 遍历删除数组;import java.util.ArrayList;import java.util.Arrays;import java.util.Iterator;import java.util.List;public class Main { public static void main(String[] args) { List list = ... 阅读全文
posted @ 2020-04-18 09:12 xl4ng 阅读(190) 评论(0) 推荐(0) 编辑
摘要:```javapackage com.company;import java.util.Iterator;public class ClassRoom implements Iterable { private String[] students; public String[] getStudents() { return students; } publi... 阅读全文
posted @ 2020-04-17 22:17 xl4ng 阅读(367) 评论(0) 推荐(0) 编辑
摘要:1.定义一个松鼠POJO 2.使用XML文件配置POJO 3.使用@ImportResource注解装配XML定义的Bean 阅读全文
posted @ 2020-04-11 22:40 xl4ng 阅读(143) 评论(0) 推荐(0) 编辑
摘要:1.新建一个ScopeBean类 默认作用域为单例,加上@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)表示多例。 2.测试 阅读全文
posted @ 2020-04-11 22:23 xl4ng 阅读(129) 评论(0) 推荐(0) 编辑
摘要:1.使用@Conditional(DatabaseConditional.class) 2.配置类DatabaseConditional 阅读全文
posted @ 2020-04-11 22:02 xl4ng 阅读(144) 评论(0) 推荐(0) 编辑
摘要:新建属性文件jdbc.properties 使用@PropertySource注解 注意点 1.需要设置环境变量CLASSPATH 2.value可以配置多个配置文件。使用classpath前缀,意味着去类文件路径下找到属性文件;ignoreResourceNotFound代表是否忽略配置文件找不到 阅读全文
posted @ 2020-04-11 21:01 xl4ng 阅读(373) 评论(0) 推荐(0) 编辑
摘要:1.导入依赖 2.编辑配置文件 3.使用属性配置 4.使用@ConfigurationProperties注解 @ConfigurationProperties中配置的字符串database,将与POJO的属性名称组成属性的全限定名去配置文件里查找,这样就能将对应的属性读入到POJO当中。 阅读全文
posted @ 2020-04-11 17:21 xl4ng 阅读(175) 评论(0) 推荐(0) 编辑
摘要:@Primary 修改Bean的优先级 @Quelifier 以类型和名称去寻找对应的Bean进行注入 带有参数的构造方法类的装配 阅读全文
posted @ 2020-04-11 11:16 xl4ng 阅读(249) 评论(0) 推荐(0) 编辑
摘要:``` package com.springboot.chapter3.pojo; import com.springboot.chapter3.pojo.definition.Animal; import com.springboot.chapter3.pojo.definition.Person; import org.springframework.beans.factory.annotat 阅读全文
posted @ 2020-04-11 11:03 xl4ng 阅读(495) 评论(0) 推荐(0) 编辑
摘要:``` // // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package org.springframework.boot.autoconfigure; import java.lang.annotation.Documented; imp 阅读全文
posted @ 2020-04-11 10:10 xl4ng 阅读(185) 评论(0) 推荐(0) 编辑
摘要:``` package com.springboot.chapter3.config; import com.springboot.chapter3.pojo.User; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configu 阅读全文
posted @ 2020-04-11 10:03 xl4ng 阅读(652) 评论(0) 推荐(0) 编辑
摘要:``` // // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package org.springframework.context.annotation; import java.lang.annotation.Documented; imp 阅读全文
posted @ 2020-04-11 09:46 xl4ng 阅读(255) 评论(0) 推荐(0) 编辑
摘要:``` package com.springboot.chapter3.pojo; public class User { private Long id; private String userName; private String note; public Long getId() { return id; } public void setId(Long id) { this.id = i 阅读全文
posted @ 2020-04-11 09:30 xl4ng 阅读(369) 评论(0) 推荐(0) 编辑
摘要:在Java中使用枚举 public class Main { public static void main(String[] args) { Season s = Season.WINTER; //打印枚举的名称 WINTRE System.out.println(s.name()); //打印枚 阅读全文
posted @ 2020-04-08 21:46 xl4ng 阅读(1434) 评论(0) 推荐(0) 编辑
摘要:``` String s = ""; Class cl1 = s.getClass(); String className1 = s.getClass().getName(); String className2 = "java.lang.String"; Class cl2 = Class.forName(className2); //如果T是任意的Java类型(或void关键字),T.clas 阅读全文
posted @ 2020-04-06 10:17 xl4ng 阅读(1310) 评论(0) 推荐(0) 编辑
摘要:Java代码 C 代码 阅读全文
posted @ 2020-04-05 18:05 xl4ng 阅读(219) 评论(0) 推荐(0) 编辑
摘要:1. flex direction属性决定主轴的方向 | 值 | 描述 | | : | : | | row | 默认值。主轴为水平⽅方向,起点在左边。 | | row reverse |主轴为水平⽅方向,起点在右边。 | | column | 主轴为垂直方向,起点在上面。 | | column re 阅读全文
posted @ 2020-04-05 10:44 xl4ng 阅读(159) 评论(0) 推荐(0) 编辑
摘要:flex布局是什什么? Flex意思是弹性布局,是css3中的新布局模块,⽤用来为盒模型提供最⼤大的灵活性。可改进容器器中的项⽬目对⻬齐,⽅方向和顺序,即使他们具有动态甚⾄是未知⼤小。Flex容器器能够调节⼦子节点的宽度或高度,以便便适应不同的屏幕尺寸。 基本概念 flex布局可以将⼀个元素看成⼀个 阅读全文
posted @ 2020-04-05 10:24 xl4ng 阅读(157) 评论(0) 推荐(0) 编辑
摘要:设置为全局 阅读全文
posted @ 2020-04-05 09:49 xl4ng 阅读(454) 评论(0) 推荐(0) 编辑
摘要:一、基本使用 1.无参数GET请求 2.带参数GET请求 3.POST请求 4.发送并发请求 5.使用全局的axios和对应的配置在进行网络请求 阅读全文
posted @ 2020-04-05 09:43 xl4ng 阅读(520) 评论(0) 推荐(0) 编辑
摘要:在样式后面加上 !important; 如 阅读全文
posted @ 2020-04-05 09:29 xl4ng 阅读(147) 评论(0) 推荐(0) 编辑