当前位置: 首页>>代码示例>>Java>>正文


Java SQLInsertClause.addBatch方法代码示例

本文整理汇总了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();
	}
}
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:25,代码来源:PublisherTransaction.java

示例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();
		}
	}
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:12,代码来源:TemplateStoreImpl.java

示例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());
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:11,代码来源:QueryDslSupportImplTest.java

示例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;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:44,代码来源:AppliedEx20ServiceImpl.java

示例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;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:44,代码来源:AppliedEx10ServiceImpl.java


注:本文中的com.mysema.query.sql.dml.SQLInsertClause.addBatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。