package tk.mybatis.mapper.test.example;

import org.apache.ibatis.session.SqlSession;
import org.junit.Assert;
import org.junit.Test;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.mapper.CountryMapper;
import tk.mybatis.mapper.mapper.MybatisHelper;
import tk.mybatis.mapper.model.Country;
import tk.mybatis.mapper.util.Sqls; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; /**
* @author wuyi
* @date 2017/11/18
*/
public class TestExampleBuilder { @Test
public void testExampleBuilder() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class).build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(183, countries.size()); // 下面的查询会有缓存
Example example0 = Example.builder(Country.class)
.select().build();
List<Country> countries0 = mapper.selectByExample(example0);
Assert.assertEquals(183, countries0.size());
} finally {
sqlSession.close();
}
} @Test
public void testDistinct() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.distinct()
.build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(183, countries.size()); // distinct和order by冲突问题
Example example0 = Example.builder(Country.class)
.selectDistinct("id", "countryname").build();
List<Country> countries0 = mapper.selectByExample(example0);
Assert.assertEquals(183, countries0.size());
} finally {
sqlSession.close();
}
} @Test
public void testForUpdate() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.select("countryname")
.where(Sqls.custom().andGreaterThan("id", 100))
.orderByAsc("countrycode")
.forUpdate()
.build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(83, countries.size());
} finally {
sqlSession.close();
}
} @Test
public void testEqualTo() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom().andEqualTo("id", "35"))
.build();
List<Country> countries = mapper.selectByExample(example);
Country country = countries.get(0);
Assert.assertEquals(Integer.valueOf(35), country.getId());
Assert.assertEquals("China", country.getCountryname());
Assert.assertEquals("CN", country.getCountrycode()); } finally {
sqlSession.close();
}
} @Test
public void testBetween() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom().andBetween("id", 34, 35))
.build();
List<Country> countries = mapper.selectByExample(example);
Country country35 = countries.get(0);
Assert.assertEquals(Integer.valueOf(35), country35.getId());
Assert.assertEquals("China", country35.getCountryname());
Assert.assertEquals("CN", country35.getCountrycode()); Country country34 = countries.get(1);
Assert.assertEquals(Integer.valueOf(34), country34.getId());
Assert.assertEquals("Chile", country34.getCountryname());
Assert.assertEquals("CL", country34.getCountrycode()); } finally {
sqlSession.close();
}
} @Test
public void testIn() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom().andIn("id", new ArrayList<Integer>(Arrays.asList(35, 183))))
.build();
List<Country> countries = mapper.selectByExample(example);
Country country35 = countries.get(1);
Assert.assertEquals(Integer.valueOf(35), country35.getId());
Assert.assertEquals("China", country35.getCountryname());
Assert.assertEquals("CN", country35.getCountrycode()); Country country183 = countries.get(0);
Assert.assertEquals(Integer.valueOf(183), country183.getId());
Assert.assertEquals("Zambia", country183.getCountryname());
Assert.assertEquals("ZM", country183.getCountrycode()); } finally {
sqlSession.close();
}
}
/*
* @description: 单个where组合查询测试
* 直接把example的构造放到selectByExample()函数里
* */
@Test
public void testWhereCompound0() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
List<Country> countries = mapper.selectByExample(
Example.builder(Country.class)
.where(Sqls.custom()
.andEqualTo("countryname", "China")
.andEqualTo("id", 35)
.orIn("id", new ArrayList<Integer>(Arrays.asList(35, 183)))
.orLike("countryname","Ye%")
)
.build());
Country country35 = countries.get(2);
Assert.assertEquals(Integer.valueOf(35), country35.getId());
Assert.assertEquals("China", country35.getCountryname());
Assert.assertEquals("CN", country35.getCountrycode()); Country country183 = countries.get(0);
Assert.assertEquals(Integer.valueOf(183), country183.getId());
Assert.assertEquals("Zambia", country183.getCountryname());
Assert.assertEquals("ZM", country183.getCountrycode()); Country country179 = countries.get(1);
Assert.assertEquals(Integer.valueOf(179), country179.getId());
Assert.assertEquals("Yemen", country179.getCountryname());
Assert.assertEquals("YE", country179.getCountrycode()); } finally {
sqlSession.close();
}
} /*
* @description: 单个where组合查询测试
* */
@Test
public void testWhereCompound1() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom()
.andBetween("id", 35, 50)
.orLessThan("id", 40)
.orIsNull("countryname")
)
.build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(50, countries.size());
} finally {
sqlSession.close();
}
}
/*
* @description: 多个where连接的查询语句测试
* */
@Test
public void testWhereAndWhereCompound() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom()
.andEqualTo("countryname", "China")
.andEqualTo("id", 35)
)
.andWhere(Sqls.custom()
.andEqualTo("id", 183)
)
.build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(0, countries.size()); } finally {
sqlSession.close();
}
} /*
* @description: 多个where连接的查询语句测试
* */
@Test
public void testWhereOrWhereCompound() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom()
.andEqualTo("countryname", "China")
.andEqualTo("id", 35)
)
.orWhere(Sqls.custom()
.andEqualTo("id", 183)
)
.build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(2, countries.size()); } finally {
sqlSession.close();
}
} /*
* @description: 多个where连接的查询语句测试
* */
@Test
public void testMultiWhereCompound() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.selectDistinct()
.where(Sqls.custom()
.andEqualTo("countryname", "China")
.andEqualTo("id", 35)
)
.orWhere(Sqls.custom()
.andBetween("countryname", 'C', 'H')
.andNotLike("countryname", "Co%")
)
.andWhere(Sqls.custom()
.andLessThan("id", "100")
.orGreaterThan("id", "55")
)
.orWhere(Sqls.custom()
.andEqualTo("countryname", "Cook Is.")
)
.orderByAsc("id", "countryname")
.orderByDesc("countrycode")
.forUpdate()
.build();
List<Country> countries = mapper.selectByExample(example);
Assert.assertEquals(35, countries.size()); } finally {
sqlSession.close();
}
} /*
* @description: 测试order by
* orderBy()默认为Asc(升序),与orderByAsc()一样
* */
@Test
public void testOrderBy() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = Example.builder(Country.class)
.where(Sqls.custom().andBetween("id", 50, 55))
.orderBy("id").orderByAsc("countryname").orderByDesc("countrycode")
.build();
List<Country> countries = mapper.selectByExample(example);
for (Country country :countries) {
System.out.println(country.getId() + " " + country.getCountryname() + " " + country.getCountrycode());
}
Assert.assertEquals(6, countries.size());
} finally {
sqlSession.close();
}
}
}
x
314
import tk.mybatis.mapper.util.Sqls;
 
1
package tk.mybatis.mapper.test.example;
2

3
import org.apache.ibatis.session.SqlSession;
4
import org.junit.Assert;
5
import org.junit.Test;
6
import tk.mybatis.mapper.entity.Example;
7
import tk.mybatis.mapper.mapper.CountryMapper;
8
import tk.mybatis.mapper.mapper.MybatisHelper;
9
import tk.mybatis.mapper.model.Country;
10
import tk.mybatis.mapper.util.Sqls;
11

12
import java.util.ArrayList;
13
import java.util.Arrays;
14
import java.util.List;
15

16
/**
17
 * @author wuyi
18
 * @date 2017/11/18
19
 */
20
public class TestExampleBuilder {
21

22
    @Test
23
    public void testExampleBuilder() {
24
        SqlSession sqlSession = MybatisHelper.getSqlSession();
25
        try {
26
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
27
            Example example = Example.builder(Country.class).build();
28
            List<Country> countries = mapper.selectByExample(example);
29
            Assert.assertEquals(183, countries.size());
30

31
            // 下面的查询会有缓存
32
            Example example0 = Example.builder(Country.class)
33
                    .select().build();
34
            List<Country> countries0 = mapper.selectByExample(example0);
35
            Assert.assertEquals(183, countries0.size());
36
        } finally {
37
            sqlSession.close();
38
        }
39
    }
40

41
    @Test
42
    public void testDistinct() {
43
        SqlSession sqlSession = MybatisHelper.getSqlSession();
44
        try {
45
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
46
            Example example = Example.builder(Country.class)
47
                    .distinct()
48
                    .build();
49
            List<Country> countries = mapper.selectByExample(example);
50
            Assert.assertEquals(183, countries.size());
51

52
            // distinct和order by冲突问题
53
            Example example0 = Example.builder(Country.class)
54
                    .selectDistinct("id", "countryname").build();
55
            List<Country> countries0 = mapper.selectByExample(example0);
56
            Assert.assertEquals(183, countries0.size());
57
        } finally {
58
            sqlSession.close();
59
        }
60
    }
61

62
    @Test
63
    public void testForUpdate() {
64
        SqlSession sqlSession = MybatisHelper.getSqlSession();
65
        try {
66
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
67
            Example example = Example.builder(Country.class)
68
                    .select("countryname")
69
                    .where(Sqls.custom().andGreaterThan("id", 100))
70
                    .orderByAsc("countrycode")
71
                    .forUpdate()
72
                    .build();
73
            List<Country> countries = mapper.selectByExample(example);
74
            Assert.assertEquals(83, countries.size());
75
        } finally {
76
            sqlSession.close();
77
        }
78
    }
79

80
    @Test
81
    public void testEqualTo() {
82
        SqlSession sqlSession = MybatisHelper.getSqlSession();
83
        try {
84
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
85
            Example example = Example.builder(Country.class)
86
                    .where(Sqls.custom().andEqualTo("id", "35"))
87
                    .build();
88
            List<Country> countries = mapper.selectByExample(example);
89
            Country country = countries.get(0);
90
            Assert.assertEquals(Integer.valueOf(35), country.getId());
91
            Assert.assertEquals("China", country.getCountryname());
92
            Assert.assertEquals("CN", country.getCountrycode());
93

94
        } finally {
95
            sqlSession.close();
96
        }
97
    }
98

99
    @Test
100
    public void testBetween() {
101
        SqlSession sqlSession = MybatisHelper.getSqlSession();
102
        try {
103
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
104
            Example example = Example.builder(Country.class)
105
                    .where(Sqls.custom().andBetween("id", 34, 35))
106
                    .build();
107
            List<Country> countries = mapper.selectByExample(example);
108
            Country country35 = countries.get(0);
109
            Assert.assertEquals(Integer.valueOf(35), country35.getId());
110
            Assert.assertEquals("China", country35.getCountryname());
111
            Assert.assertEquals("CN", country35.getCountrycode());
112

113
            Country country34 = countries.get(1);
114
            Assert.assertEquals(Integer.valueOf(34), country34.getId());
115
            Assert.assertEquals("Chile", country34.getCountryname());
116
            Assert.assertEquals("CL", country34.getCountrycode());
117

118
        } finally {
119
            sqlSession.close();
120
        }
121
    }
122

123
    @Test
124
    public void testIn() {
125
        SqlSession sqlSession = MybatisHelper.getSqlSession();
126
        try {
127
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
128
            Example example = Example.builder(Country.class)
129
                    .where(Sqls.custom().andIn("id", new ArrayList<Integer>(Arrays.asList(35, 183))))
130
                    .build();
131
            List<Country> countries = mapper.selectByExample(example);
132
            Country country35 = countries.get(1);
133
            Assert.assertEquals(Integer.valueOf(35), country35.getId());
134
            Assert.assertEquals("China", country35.getCountryname());
135
            Assert.assertEquals("CN", country35.getCountrycode());
136

137
            Country country183 = countries.get(0);
138
            Assert.assertEquals(Integer.valueOf(183), country183.getId());
139
            Assert.assertEquals("Zambia", country183.getCountryname());
140
            Assert.assertEquals("ZM", country183.getCountrycode());
141

142
        } finally {
143
            sqlSession.close();
144
        }
145
    }
146
    /*
147
    * @description: 单个where组合查询测试
148
    * 直接把example的构造放到selectByExample()函数里
149
    * */
150
    @Test
151
    public void testWhereCompound0() {
152
        SqlSession sqlSession = MybatisHelper.getSqlSession();
153
        try {
154
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
155
            List<Country> countries = mapper.selectByExample(
156
                    Example.builder(Country.class)
157
                    .where(Sqls.custom()
158
                            .andEqualTo("countryname", "China")
159
                            .andEqualTo("id", 35)
160
                            .orIn("id", new ArrayList<Integer>(Arrays.asList(35, 183)))
161
                            .orLike("countryname","Ye%")
162
                    )
163
                    .build());
164
            Country country35 = countries.get(2);
165
            Assert.assertEquals(Integer.valueOf(35), country35.getId());
166
            Assert.assertEquals("China", country35.getCountryname());
167
            Assert.assertEquals("CN", country35.getCountrycode());
168

169
            Country country183 = countries.get(0);
170
            Assert.assertEquals(Integer.valueOf(183), country183.getId());
171
            Assert.assertEquals("Zambia", country183.getCountryname());
172
            Assert.assertEquals("ZM", country183.getCountrycode());
173

174
            Country country179 = countries.get(1);
175
            Assert.assertEquals(Integer.valueOf(179), country179.getId());
176
            Assert.assertEquals("Yemen", country179.getCountryname());
177
            Assert.assertEquals("YE", country179.getCountrycode());
178

179
        } finally {
180
            sqlSession.close();
181
        }
182
    }
183

184
    /*
185
     * @description: 单个where组合查询测试
186
     * */
187
    @Test
188
    public void testWhereCompound1() {
189
        SqlSession sqlSession = MybatisHelper.getSqlSession();
190
        try {
191
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
192
            Example example = Example.builder(Country.class)
193
                    .where(Sqls.custom()
194
                        .andBetween("id", 35, 50)
195
                        .orLessThan("id", 40)
196
                        .orIsNull("countryname")
197
                    )
198
                    .build();
199
            List<Country> countries = mapper.selectByExample(example);
200
            Assert.assertEquals(50, countries.size());
201
        } finally {
202
            sqlSession.close();
203
        }
204
    }
205
    /*
206
    *   @description: 多个where连接的查询语句测试
207
    * */
208
    @Test
209
    public void testWhereAndWhereCompound() {
210
        SqlSession sqlSession = MybatisHelper.getSqlSession();
211
        try {
212
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
213
            Example example = Example.builder(Country.class)
214
                    .where(Sqls.custom()
215
                        .andEqualTo("countryname", "China")
216
                        .andEqualTo("id", 35)
217
                    )
218
                    .andWhere(Sqls.custom()
219
                        .andEqualTo("id", 183)
220
                    )
221
                    .build();
222
            List<Country> countries = mapper.selectByExample(example);
223
            Assert.assertEquals(0, countries.size());
224

225
        } finally {
226
            sqlSession.close();
227
        }
228
    }
229

230
    /*
231
     *   @description: 多个where连接的查询语句测试
232
     * */
233
    @Test
234
    public void testWhereOrWhereCompound() {
235
        SqlSession sqlSession = MybatisHelper.getSqlSession();
236
        try {
237
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
238
            Example example = Example.builder(Country.class)
239
                    .where(Sqls.custom()
240
                            .andEqualTo("countryname", "China")
241
                            .andEqualTo("id", 35)
242
                    )
243
                    .orWhere(Sqls.custom()
244
                            .andEqualTo("id", 183)
245
                    )
246
                    .build();
247
            List<Country> countries = mapper.selectByExample(example);
248
            Assert.assertEquals(2, countries.size());
249

250
        } finally {
251
            sqlSession.close();
252
        }
253
    }
254

255
    /*
256
     *   @description: 多个where连接的查询语句测试
257
     * */
258
    @Test
259
    public void testMultiWhereCompound() {
260
        SqlSession sqlSession = MybatisHelper.getSqlSession();
261
        try {
262
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
263
            Example example = Example.builder(Country.class)
264
                    .selectDistinct()
265
                    .where(Sqls.custom()
266
                        .andEqualTo("countryname", "China")
267
                        .andEqualTo("id", 35)
268
                    )
269
                    .orWhere(Sqls.custom()
270
                        .andBetween("countryname", 'C', 'H')
271
                        .andNotLike("countryname", "Co%")
272
                    )
273
                    .andWhere(Sqls.custom()
274
                        .andLessThan("id", "100")
275
                        .orGreaterThan("id", "55")
276
                    )
277
                    .orWhere(Sqls.custom()
278
                        .andEqualTo("countryname", "Cook Is.")
279
                    )
280
                    .orderByAsc("id", "countryname")
281
                    .orderByDesc("countrycode")
282
                    .forUpdate()
283
                    .build();
284
            List<Country> countries = mapper.selectByExample(example);
285
            Assert.assertEquals(35, countries.size());
286

287
        } finally {
288
            sqlSession.close();
289
        }
290
    }
291

292
    /*
293
    *  @description: 测试order by
294
    *  orderBy()默认为Asc(升序),与orderByAsc()一样
295
    * */
296
    @Test
297
    public void testOrderBy() {
298
        SqlSession sqlSession = MybatisHelper.getSqlSession();
299
        try {
300
            CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
301
            Example example = Example.builder(Country.class)
302
                    .where(Sqls.custom().andBetween("id", 50, 55))
303
                    .orderBy("id").orderByAsc("countryname").orderByDesc("countrycode")
304
                    .build();
305
            List<Country> countries = mapper.selectByExample(example);
306
            for (Country country :countries) {
307
                System.out.println(country.getId() + " " + country.getCountryname() + " " + country.getCountrycode());
308
            }
309
            Assert.assertEquals(6, countries.size());
310
        } finally {
311
            sqlSession.close();
312
        }
313
    }
314
}

通用Mapper新特性:ExampleBuilder 2017年12月18日的更多相关文章

  1. 12月18日风险投资速递:Facebook收购实时体育数据提供商Sport Stream

    国内公司 1.手游公司成都掌沃无限获得近千万元天使投资 成都掌沃无限成立于2013年,是一家新成立的手机游戏开发商,创始人及CEO张涛拥有超过10年的游戏行业从业经验和连续创业经历,其首款游戏产品为& ...

  2. 2016年12月18日 星期日 --出埃及记 Exodus 21:13

    2016年12月18日 星期日 --出埃及记 Exodus 21:13 However, if he does not do it intentionally, but God lets it hap ...

  3. 北京Uber优步司机奖励政策(12月18日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  4. 深度学习DeepLearning技术实战(12月18日---21日)

    12月线上课程报名中 深度学习DeepLearning(Python)实战培训班 时间地点: 2020 年 12 月 18 日-2020 年 12 月 21日 (第一天报到 授课三天:提前环境部署 电 ...

  5. 2017年12月17日 ASP.NET 12个表单元素&&简单控件/复合控件

    12个表单元素可以分为三大类 第一类:文本类 <input type = "text" /> //普通文本框 <input type = "passwo ...

  6. 2017年12月24日 JS跟Jquery基础

    js基础 alert();confirm(); 基础语法:与C#一致数据类型及类型转换var (string,decimal)parseInt()parseFloat();isNaN(); 运算符:数 ...

  7. 2017年12月16日 ASP.NET基本用法

    ASP.NET初级添加 利用css代码跟ASP.NET还有Javascript原生,LinQ来写增跟展示数据 首先介绍一个非常好用的控件,灵活并且循环展示数据库里面的数据 <asp:Repeat ...

  8. 2017年12月14日 LinQ高级查&&Asp.net WebForm Asp.net MVC

    LinQ的高级查询用法 开头:StartsWith()结尾:EndsWith()模糊:Contains() 个数:Count最大值:Max(r => r.price)最小值:Min(r => ...

  9. 2017年12月13日 LinQ用法基本的增删改查

    LinQ是什么? LinQ是语言集成的查询,是用于C#跟Vb的扩展语言 LinQ的用法 新建一个App_Code文件夹,在文件夹下添加一个数据LinQ to SQL类,可以直接直接点击服务器管理器然后 ...

随机推荐

  1. Java转型

    集合转型 通过中间类型List List<String> strs=new ArrayList<>(); List list=(List)strs; List<Objec ...

  2. IntelliJ IDEA无法更新maven索引

    maven索引的作用时在添加dependency的时候能有自动提示,不影响dependency的下载: 解决办法: 1.http://ju.outofmemory.cn/entry/359450 2. ...

  3. MPU和CPU有什么区别?

    MPU(或称MP,微处理器)和CPU(中央处理器)同为处理器,但范畴不同. 计算机(即电脑)分为巨型机,大型机,中型机,小型机和微型计算机5类.这5类计算机的运算核心统称为CPU,而MPU只是微型计算 ...

  4. Shooting Contest 射击比赛 [POJ1719] [CEOI1997] [一题多解]

    Description(下有中文题意) Welcome to the Annual Byteland Shooting Contest. Each competitor will shoot to a ...

  5. mysql找安装路经,更改密码

    1:如果安装了mysql但是启动不了,可以到C:/Windows/System32的cmd.exe,用管理员身份打开,然后输入net strat mysql即可 2:忘记安装路经       sele ...

  6. list(列表) python

    1.list(列表): list是处理一组有序项目的数据结构 list(列表)是python中使用最频繁的数据类型 list中什么类型的数据都可以存放(如:类.自己.函数......): list(列 ...

  7. Spring mvc前台后台传值

    前台向后台传值: ①同名参数传递:form表单中提交input,Controller方法入参中,直接以同名参数获取 ②不同名参数传递:from表单提交input,Controller方法入参中需要使用 ...

  8. Git 和 Repo常用命令

    这篇博客总结的也不错: git常用及进阶命令总结 Git与Repo入门 一.初始環境配置 git config --global user.name "John Doe"git c ...

  9. 【springboot】【redis】springboot+redis实现发布订阅功能,实现redis的消息队列的功能

    springboot+redis实现发布订阅功能,实现redis的消息队列的功能 参考:https://www.cnblogs.com/cx987514451/p/9529611.html 思考一个问 ...

  10. Mac下不用重复输入ssh-key的密码

    重装系统,复用以前的SSH key,发现每次调用这个Key都要输入Key的密码,很繁琐,以前不是这样的哦. 更新代码.SSH服务器总是提示: Enter passphrase for .../id_r ...