mybatis.batch

批量提交插件

License

License

Categories

Categories

MyBatis Data ORM
GroupId

GroupId

com.github.liuaixi200
ArtifactId

ArtifactId

mybatis-batch-parent
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

mybatis.batch
批量提交插件
Project URL

Project URL

https://github.com/liuaixi200/mybatis-batch-parent
Source Code Management

Source Code Management

https://github.com/liuaixi200/mybatis-batch-parent.git

Download mybatis-batch-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.liuaixi200/mybatis-batch-parent/ -->
<dependency>
    <groupId>com.github.liuaixi200</groupId>
    <artifactId>mybatis-batch-parent</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.liuaixi200/mybatis-batch-parent/
implementation 'com.github.liuaixi200:mybatis-batch-parent:1.0.0'
// https://jarcasting.com/artifacts/com.github.liuaixi200/mybatis-batch-parent/
implementation ("com.github.liuaixi200:mybatis-batch-parent:1.0.0")
'com.github.liuaixi200:mybatis-batch-parent:pom:1.0.0'
<dependency org="com.github.liuaixi200" name="mybatis-batch-parent" rev="1.0.0">
  <artifact name="mybatis-batch-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.liuaixi200', module='mybatis-batch-parent', version='1.0.0')
)
libraryDependencies += "com.github.liuaixi200" % "mybatis-batch-parent" % "1.0.0"
[com.github.liuaixi200/mybatis-batch-parent "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • mybatis-batch
  • mybatis-batch-autoconfiguration
  • mybatis-batch-starter

#如果你的项目是spring-boot开发的,按如下引用就可以了

       <dependency>
            <groupId>com.github.liuaixi200</groupId>
            <artifactId>mybatis-batch-starter</artifactId>
            <version>1.0.0</version>
        </dependency>

#支持的参数 到达多少数时自动提交。 mybatis.batch.batchCommit: 5000

#代码中使用

public void test1(){
        MybatisBatchHelper.startBatch();
        for(int i = 0;i<5000;i++){
            OssParseLog log = new OssParseLog();
            log.setBatchId(i+"");
            log.setCrtTime(new Date());
            log.setName("aaaa");
            log.setHhmmss("112233");
            log.setType("test1");
            log.setApp("0001");
            baseManagr.insertSelective(log);
        }
    }

Versions

Version
1.0.0