hupu面试
2024-09-01 14:23:14
1.mybatis更新一条数据时,如果某字段为空,则不更新它,使用默认值?
<update id="updateProduct" parameterType="Product" >
update product_
<set>
<if test="name != null">name=#{name},</if>
<if test="price != null">price=#{price}</if>
</set>
where id=#{id}
</update>
2.mybatis如何插入一个list类型的记录?
<insert id="addItem" parameterType="java.util.List">
insert into product_ ( id, itemName, number, remark )
values
<foreach collection="list" item="item" index= "index" separator =",">
( #{item.id}, #{item.itemName}, #{item.number}, #{item.remark} )
</foreach>
</insert>
SpringBoot 异步编程实战
如果我们需要在 SpringBoot 实现异步编程的话,通过 Spring 提供的两个注解会让这件事情变的非常简单。
@EnableAsync
:通过在配置类或者Main类上加@EnableAsync开启对异步方法的支持。@Async
可以作用在类上或者方法上,作用在类上代表这个类的所有方法都是异步方法。
1. 自定义 TaskExecutor
很多人对于 TaskExecutor 不是太了解,所以我们花一点篇幅先介绍一下这个东西。从名字就能看出它是任务的执行者,它领导执行着线程来处理任务,就像司令官一样,而我们的线程就好比一只只军队一样,这些军队可以异步对敌人进行打击
最新文章
- Struts2 JSON
- spark reduce类操作
- EPANET能做什么,不能做什么
- Perl 模块 Getopt::Std 和 Getopt::Long
- Ext.Net学习笔记15:Ext.Net GridPanel 汇总(Summary)用法
- layer.js子窗口关闭并传数据到父窗的方法
- Android和FTP服务器交互,上传下载文件(实例demo)
- AngularJs directive &#39;transclude&#39; option 详解
- Lottie安卓开源动画库使用
- 用Visual Studio2017写静态库
- Excel 若某列包含某个字符则特定列显示特定字符
- webpackJsonp is not defined
- LeetCode之“排序”:Largest Number
- 英语口语练习系列-C13-聚会
- CSS3无前缀脚本prefixfree.js与Animatable使用介绍
- 构建RequestDelegate管道
- JS 中div内容的显示和隐藏
- Linux 的字符串截取
- Android中如何判断升级用户
- 学习《深入理解C#》—— 可空类型、可选参数和默认值 (第一章1.3)
热门文章
- 洛谷 P1076 寻宝 题解
- Chrome安装.crx文件
- 历年NOIP回顾
- 【转】harbor仓库高可用集群部署说明
- SpringBoot JPA懒加载异常 - com.fasterxml.jackson.databind.JsonMappingException: could not initialize proxy
- ElasticSearch java客户端更新时出现的错误:NoNodeAvailableException[None of the configured nodes are available
- maven引入第三方jar包
- hadoop2.9.2 调整jvm
- Alpha项目冲刺! Day5-产出
- c++比例-libcurl多线程并发时的core【转载】