Tabnine Logo
SQLInsertClause.getBatchCount
Code IndexAdd Tabnine to your IDE (free)

How to use
getBatchCount
method
in
com.querydsl.sql.dml.SQLInsertClause

Best Java code snippets using com.querydsl.sql.dml.SQLInsertClause.getBatchCount (Showing top 5 results out of 315)

origin: org.huiche/huiche-dao

long size = insert.getBatchCount();
if (size > 0) {
  if (createSetId()) {
origin: org.huiche/huiche-dao

  /**
   * 批量插入数据,可以携带ID,但没有ID的不会进行ID赋值
   *
   * @param entityList 实体
   * @return 变更条数
   */
  default long createWithId(@Nonnull Collection<T> entityList) {
    SQLInsertClause insert = sql().insert(root());
    entityList.forEach(t -> {
      beforeCreate(t);
      validOnCreate(t);
      insert.populate(t, DefaultMapper.WITH_NULL_BINDINGS).addBatch();
    });
    long size = insert.getBatchCount();
    if (size > 0) {
      insert.execute();
    }
    insert.clear();
    return size;
  }
}
origin: com.querydsl/querydsl-sql

@Test
public void clear() {
  QEmployee emp1 = new QEmployee("emp1");
  SQLInsertClause insert = new SQLInsertClause(null, SQLTemplates.DEFAULT, emp1);
  insert.set(emp1.id, 1);
  insert.addBatch();
  assertEquals(1, insert.getBatchCount());
  insert.clear();
  assertEquals(0, insert.getBatchCount());
}
origin: com.querydsl/querydsl-sql

@Test
public void insert_batch() {
  SQLInsertClause insert = insert(survey)
      .set(survey.id, 5)
      .set(survey.name, "55")
      .addBatch();
  assertEquals(1, insert.getBatchCount());
  insert.set(survey.id, 6)
      .set(survey.name, "66")
      .addBatch();
  assertEquals(2, insert.getBatchCount());
  assertEquals(2, insert.execute());
  assertEquals(1L, query().from(survey).where(survey.name.eq("55")).fetchCount());
  assertEquals(1L, query().from(survey).where(survey.name.eq("66")).fetchCount());
}
origin: com.querydsl/querydsl-sql

@Test
public void insert_batch_to_bulk() {
  SQLInsertClause insert = insert(survey);
  insert.setBatchToBulk(true);
  insert.set(survey.id, 5)
      .set(survey.name, "55")
      .addBatch();
  assertEquals(1, insert.getBatchCount());
  insert.set(survey.id, 6)
      .set(survey.name, "66")
      .addBatch();
  assertEquals(2, insert.getBatchCount());
  assertEquals(2, insert.execute());
  assertEquals(1L, query().from(survey).where(survey.name.eq("55")).fetchCount());
  assertEquals(1L, query().from(survey).where(survey.name.eq("66")).fetchCount());
}
com.querydsl.sql.dmlSQLInsertClausegetBatchCount

Popular methods of SQLInsertClause

  • execute
  • executeWithKey
  • set
  • <init>
  • addBatch
  • columns
  • executeWithKeys
  • addFlag
  • addListener
  • clear
  • populate
  • values
  • populate,
  • values,
  • getSQL,
  • select,
  • setBatchToBulk,
  • setNull,
  • toString

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Kernel (java.awt.image)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now