本文整理汇总了Java中com.mysema.query.sql.dml.SQLInsertClause.addBatch方法的典型用法代码示例。如果您正苦于以下问题:Java SQLInsertClause.addBatch方法的具体用法?Java SQLInsertClause.addBatch怎么用?Java SQLInsertClause.addBatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mysema.query.sql.dml.SQLInsertClause
的用法示例。
在下文中一共展示了SQLInsertClause.addBatch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executePerformInsert
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private Object executePerformInsert(PerformInsert query) {
SQLInsertClause insert = insert(query.getEntity());
Iterator<PerformInsertBatch> batchItr = query.getBatches().iterator();
processInsertBatch(insert, batchItr.next());
if(batchItr.hasNext()) {
insert.addBatch();
while(batchItr.hasNext()) {
processInsertBatch(insert, batchItr.next());
insert.addBatch();
}
}
Optional<Path<?>> key = query.getKey();
if(key.isPresent()) {
return toTypedList(insert, key.get());
} else {
return insert.execute();
}
}
示例2: setupInsertClause
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void setupInsertClause(SQLInsertClause insert, QMailTemplateRcpt mtr, Long templateId, String type,
List<String> list) {
if (list != null) {
for (String addr : list) {
insert.set(mtr.templateId, templateId);
insert.set(mtr.rcptType, type);
insert.set(mtr.rcptAddr, addr);
insert.addBatch();
}
}
}
示例3: before
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Before
public void before() {
SQLInsertClause insert = queryFactory.insert(vd);
for (int i = -100; i <= 100; i++) {
insert.set(vd.dt, localDate.plusDays(i));
insert.set(vd.dtm, localDateTime.plusDays(i));
insert.addBatch();
}
assertEquals(201L, insert.execute());
}
示例4: create
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional
@Override
public Long create(AppliedEx20Form form) {
SQLInsertClause insert = qf.insert(et1);
if (StringUtils.isNotEmpty(form.getText10())) {
insert.set(et1.text10, form.getText10());
}
if (StringUtils.isNotEmpty(form.getText100())) {
insert.set(et1.text100, form.getText100());
}
insert.set(et1.int64, form.getInt64());
insert.set(et1.decimal1, form.getDecimal1());
insert.set(et1.decimal3, form.getDecimal3());
insert.set(et1.dt, form.getDt());
insert.set(et1.tm, form.getTm());
insert.set(et1.dtm, form.getDtm());
Long id = insert.executeWithKey(et1.id);
SQLInsertClause insertSub = qf.insert(et2);
for (AppliedEx20SubForm sf : form.getItem()) {
insertSub.set(et2.parentId, id);
if (StringUtils.isNotEmpty(sf.getText10())) {
insertSub.set(et2.text10, sf.getText10());
}
if (StringUtils.isNotEmpty(sf.getText100())) {
insertSub.set(et2.text100, sf.getText100());
}
insertSub.set(et2.int64, sf.getInt64());
insertSub.set(et2.decimal1, sf.getDecimal1());
insertSub.set(et2.decimal3, sf.getDecimal3());
insertSub.set(et2.dt, sf.getDt());
insertSub.set(et2.tm, sf.getTm());
insertSub.set(et2.dtm, sf.getDtm());
insertSub.addBatch();
}
long count = insertSub.execute();
if (count != form.getItem().size()) {
throw new IllegalStateException();
}
return id;
}
示例5: create
import com.mysema.query.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
@Transactional
@Override
public Long create(AppliedEx10Form form) {
SQLInsertClause insert = qf.insert(et1);
if (StringUtils.isNotEmpty(form.getText10())) {
insert.set(et1.text10, form.getText10());
}
if (StringUtils.isNotEmpty(form.getText100())) {
insert.set(et1.text100, form.getText100());
}
insert.set(et1.int64, form.getInt64());
insert.set(et1.decimal1, form.getDecimal1());
insert.set(et1.decimal3, form.getDecimal3());
insert.set(et1.dt, form.getDt());
insert.set(et1.tm, form.getTm());
insert.set(et1.dtm, form.getDtm());
Long id = insert.executeWithKey(et1.id);
SQLInsertClause insertSub = qf.insert(et2);
for (AppliedEx10SubForm sf : form.getItem()) {
insertSub.set(et2.parentId, id);
if (StringUtils.isNotEmpty(sf.getText10())) {
insertSub.set(et2.text10, sf.getText10());
}
if (StringUtils.isNotEmpty(sf.getText100())) {
insertSub.set(et2.text100, sf.getText100());
}
insertSub.set(et2.int64, sf.getInt64());
insertSub.set(et2.decimal1, sf.getDecimal1());
insertSub.set(et2.decimal3, sf.getDecimal3());
insertSub.set(et2.dt, sf.getDt());
insertSub.set(et2.tm, sf.getTm());
insertSub.set(et2.dtm, sf.getDtm());
insertSub.addBatch();
}
long count = insertSub.execute();
if (count != form.getItem().size()) {
throw new IllegalStateException();
}
return id;
}