liteBatch 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
liteBatch 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
liteBatch 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 Apache
开发语言 Java
操作系统 跨平台
软件类型 开源软件
开源组织
地区 国产
投 递 者 铂赛东
适用人群 未知
收录时间 2018-04-02

软件简介

liteBatch 是一个轻量级,高性能,高通用的批插框架。

  • 能够像普通 insert 一样在循环中插入 PO

  • 支持数据库和文件批插2种模式

  • 异步执行,无阻塞

  • 可以和各种 ORM 结合使用

  • 提供对 spring 的支持

  • 兼容各种数据库

  • 适应所有的 VO ,自动生成脚本

  • 性能高效,测试机上测试大概4w+/秒

  • 自动处理各种基础类型的数据

  • 支持自定义的映射和过滤字段

Quick Start

也可以参考 test 工程的 testUnit

	try {
		Random random = new Random();
		Person person = null;
		for (int i = 0; i < 100300; i++) {
			person = new Person();
			person.setAge(random.nextInt(100));
			person.setAddress("XX马路"+random.nextInt(100)+"号");
			person.setCompany("天天 向上科技有限公司");
			person.setName("张三");
			person.setCreateTime(new Date());
			rowBatchListener.insertOneWithBatch(person);
		}
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		rowBatchListener.flush();
	}
	<bean id="rowBatchListener"  class="com.thebeastshop.batch.spring.RowBatchListenerFactoryBean">
		<property name="jdbcTemplate" ref="jdbcTemplate"/>
		<property name="submitCapacity" value="5000"/>
		<property name="beanClass" value="com.thebeastshop.batch.test.Person"/>
		<!--<property name="syn" value="true"/>默认为false,推荐采用false,打开的话,则为同步模式-->
	</bean>

注意

在mysql数据库下,需要注意以下几点

  • 驱动包一定得5.1.13版本以上(含)

  • 在jdbc连接url里得加上rewriteBatchedStatements=true参数

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
4 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部